From: mberg at synacor dot com
Operating system: Red Hat Linux 7.2 (ish)
PHP version: 4.4.2
PHP Bug Type: Apache related
Bug description: Fix for #35646 incorrect
Description:
------------
The fix for bug #35646 results in mod_php_memory_usage always being set to
0. The proper fix seems to already be implemented in the Apache 1.x
handler, so it should just be a matter of rolling back the broken fix and
copying the right one into the apache2handler.
<pre>
diff -u2 -r php-4.4.2.orig/Zend/zend_alloc.c php-4.4.2/Zend/zend_alloc.c
--- php-4.4.2.orig/Zend/zend_alloc.c Sun Jan 1 08:46:49 2006
+++ php-4.4.2/Zend/zend_alloc.c Fri Mar 10 16:59:18 2006
@@ -539,5 +539,4 @@
#if MEMORY_LIMIT
AG(memory_exhausted)=0;
- AG(allocated_memory_peak) = 0;
#endif
diff -u2 -r php-4.4.2.orig/sapi/apache2handler/sapi_apache2.c
php-4.4.2/sapi/apache2handler/sapi_apache2.c
--- php-4.4.2.orig/sapi/apache2handler/sapi_apache2.c Sun Jan 1
08:47:01 2006
+++ php-4.4.2/sapi/apache2handler/sapi_apache2.c Mon Mar 13
14:47:52 2006
@@ -588,4 +588,5 @@
mem_usage = apr_psprintf(ctx->r->pool, "%u",
AG(allocated_memory_peak));
+ AG(allocated_memory_peak) = 0;
apr_table_set(r->notes, "mod_php_memory_usage",
mem_usage);
</pre>
--
Edit bug report at http://bugs.php.net/?id=36724&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=36724&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=36724&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=36724&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36724&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=36724&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36724&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36724&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36724&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36724&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36724&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=36724&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=36724&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36724&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36724&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36724&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36724&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36724&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36724&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36724&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36724&r=mysqlcfg