#36724 [Fbk-Opn]: Fix for #35646 incorrect
ID: 36724 User updated by: mberg at synacor dot com Reported By: mberg at synacor dot com -Status: Feedback +Status: Open Bug Type: Apache related Operating System: Red Hat Linux 7.2 (ish) PHP Version: 4.4.2 Assigned To: tony2001 New Comment: Same behaviour. Same fix. Tested on CentOS 4.2 as well. Same behaviour. Same fix. Previous Comments: [2006-03-16 08:29:33] [EMAIL PROTECTED] I didn't say you need to move all your servers to 5.1. I just asked you to test it and see if the same happens with 5.1 for you, because I'm unable to reproduce it. [2006-03-15 18:28:05] mberg at synacor dot com We have no plans to move to PHP 5.x in the near future. [2006-03-15 18:15:10] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.1-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.1-win32-latest.zip [2006-03-15 17:47:47] mberg at synacor dot com We're always getting a value of 0 logged for %{mod_php_memory_usage} using stock 4.4.2 with Apache 1.3.34. It worked as expected with 4.3.11. Reverting the change introduced in bug #35646 with the following patch fixed it for us: --- php-4.4.2.orig/Zend/zend_alloc.cSun Jan 1 08:46:49 2006 +++ php-4.4.2/Zend/zend_alloc.c Fri Mar 10 16:59:18 2006 @@ -541 +540,0 @@ - AG(allocated_memory_peak) = 0; This presumably breaks Apache 2.x though (_that_ I haven't tested), which is where the second part of my suggested fix comes in. This is just clearing the value in the bit of code in apache2handler that's analagous to where it was cleared in mod_php4.c. [2006-03-15 17:33:10] [EMAIL PROTECTED] I still don't get it. Did you test it? Does it work for you? The current way is to zero twice: 1) it in the beginning of the request, when memory manager starts. 2) in the end of the request, when memory manager goes down. What makes you think it's wrong if you didn't even test it? The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/36724 -- Edit this bug report at http://bugs.php.net/?id=36724edit=1
#36724 [Fbk-Opn]: Fix for #35646 incorrect
ID: 36724 User updated by: mberg at synacor dot com Reported By: mberg at synacor dot com -Status: Feedback +Status: Open Bug Type: Apache related Operating System: Red Hat Linux 7.2 (ish) PHP Version: 4.4.2 Assigned To: tony2001 New Comment: That sounds like you're testing with 2.x. My installation is 1.x. Not sure if you have memory_limit set in php.ini, but that's required for this to show up as well. Previous Comments: [2006-03-15 15:12:39] [EMAIL PROTECTED] I can't reproduce it with both prefork and threaded MPM. [2006-03-13 20:54:44] mberg at synacor dot com 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.cSun 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.cMon 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 this bug report at http://bugs.php.net/?id=36724edit=1
#36724 [Fbk-Opn]: Fix for #35646 incorrect
ID: 36724 User updated by: mberg at synacor dot com Reported By: mberg at synacor dot com -Status: Feedback +Status: Open Bug Type: Apache related Operating System: Red Hat Linux 7.2 (ish) PHP Version: 4.4.2 Assigned To: tony2001 New Comment: I meant that the problem described in #35646 was fixed (or perhaps was never broken?) in Apache 1.x. If you look at sapi/apache/mod_php4.c, allocated_memory_peak is zeroed after it's retrieved: mem_usage = ap_psprintf(r-pool, %u, AG(allocated_memory_peak)); AG(allocated_memory_peak) = 0; ap_table_setn(r-notes, mod_php_memory_usage, mem_usage); The patch I submitted alters the similar code in apache2handler/sapi_apache2.c to zero it out there, instead of Zend/zend_alloc.c, since that's zeroing it before the apache variable is set. Previous Comments: [2006-03-15 17:00:50] [EMAIL PROTECTED] That sounds like you're testing with 2.x. Apparently yes, sapi/apache2handler is for Apache2. My installation is 1.x. Then your report doesn't make any sense to me. You've said that it's fixed for Apache 1.x or what did you mean by that? [2006-03-15 16:04:17] mberg at synacor dot com That sounds like you're testing with 2.x. My installation is 1.x. Not sure if you have memory_limit set in php.ini, but that's required for this to show up as well. [2006-03-15 15:12:39] [EMAIL PROTECTED] I can't reproduce it with both prefork and threaded MPM. [2006-03-13 20:54:44] mberg at synacor dot com 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.cSun 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.cMon 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 this bug report at http://bugs.php.net/?id=36724edit=1
#36724 [Fbk-Opn]: Fix for #35646 incorrect
ID: 36724 User updated by: mberg at synacor dot com Reported By: mberg at synacor dot com -Status: Feedback +Status: Open Bug Type: Apache related Operating System: Red Hat Linux 7.2 (ish) PHP Version: 4.4.2 Assigned To: tony2001 New Comment: We're always getting a value of 0 logged for %{mod_php_memory_usage} using stock 4.4.2 with Apache 1.3.34. It worked as expected with 4.3.11. Reverting the change introduced in bug #35646 with the following patch fixed it for us: --- php-4.4.2.orig/Zend/zend_alloc.cSun Jan 1 08:46:49 2006 +++ php-4.4.2/Zend/zend_alloc.c Fri Mar 10 16:59:18 2006 @@ -541 +540,0 @@ - AG(allocated_memory_peak) = 0; This presumably breaks Apache 2.x though (_that_ I haven't tested), which is where the second part of my suggested fix comes in. This is just clearing the value in the bit of code in apache2handler that's analagous to where it was cleared in mod_php4.c. Previous Comments: [2006-03-15 17:33:10] [EMAIL PROTECTED] I still don't get it. Did you test it? Does it work for you? The current way is to zero twice: 1) it in the beginning of the request, when memory manager starts. 2) in the end of the request, when memory manager goes down. What makes you think it's wrong if you didn't even test it? [2006-03-15 17:28:40] mberg at synacor dot com I meant that the problem described in #35646 was fixed (or perhaps was never broken?) in Apache 1.x. If you look at sapi/apache/mod_php4.c, allocated_memory_peak is zeroed after it's retrieved: mem_usage = ap_psprintf(r-pool, %u, AG(allocated_memory_peak)); AG(allocated_memory_peak) = 0; ap_table_setn(r-notes, mod_php_memory_usage, mem_usage); The patch I submitted alters the similar code in apache2handler/sapi_apache2.c to zero it out there, instead of Zend/zend_alloc.c, since that's zeroing it before the apache variable is set. [2006-03-15 17:00:50] [EMAIL PROTECTED] That sounds like you're testing with 2.x. Apparently yes, sapi/apache2handler is for Apache2. My installation is 1.x. Then your report doesn't make any sense to me. You've said that it's fixed for Apache 1.x or what did you mean by that? [2006-03-15 16:04:17] mberg at synacor dot com That sounds like you're testing with 2.x. My installation is 1.x. Not sure if you have memory_limit set in php.ini, but that's required for this to show up as well. [2006-03-15 15:12:39] [EMAIL PROTECTED] I can't reproduce it with both prefork and threaded MPM. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/36724 -- Edit this bug report at http://bugs.php.net/?id=36724edit=1
#36724 [Fbk-Opn]: Fix for #35646 incorrect
ID: 36724 User updated by: mberg at synacor dot com Reported By: mberg at synacor dot com -Status: Feedback +Status: Open Bug Type: Apache related Operating System: Red Hat Linux 7.2 (ish) PHP Version: 4.4.2 Assigned To: tony2001 New Comment: We have no plans to move to PHP 5.x in the near future. Previous Comments: [2006-03-15 18:15:10] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.1-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.1-win32-latest.zip [2006-03-15 17:47:47] mberg at synacor dot com We're always getting a value of 0 logged for %{mod_php_memory_usage} using stock 4.4.2 with Apache 1.3.34. It worked as expected with 4.3.11. Reverting the change introduced in bug #35646 with the following patch fixed it for us: --- php-4.4.2.orig/Zend/zend_alloc.cSun Jan 1 08:46:49 2006 +++ php-4.4.2/Zend/zend_alloc.c Fri Mar 10 16:59:18 2006 @@ -541 +540,0 @@ - AG(allocated_memory_peak) = 0; This presumably breaks Apache 2.x though (_that_ I haven't tested), which is where the second part of my suggested fix comes in. This is just clearing the value in the bit of code in apache2handler that's analagous to where it was cleared in mod_php4.c. [2006-03-15 17:33:10] [EMAIL PROTECTED] I still don't get it. Did you test it? Does it work for you? The current way is to zero twice: 1) it in the beginning of the request, when memory manager starts. 2) in the end of the request, when memory manager goes down. What makes you think it's wrong if you didn't even test it? [2006-03-15 17:28:40] mberg at synacor dot com I meant that the problem described in #35646 was fixed (or perhaps was never broken?) in Apache 1.x. If you look at sapi/apache/mod_php4.c, allocated_memory_peak is zeroed after it's retrieved: mem_usage = ap_psprintf(r-pool, %u, AG(allocated_memory_peak)); AG(allocated_memory_peak) = 0; ap_table_setn(r-notes, mod_php_memory_usage, mem_usage); The patch I submitted alters the similar code in apache2handler/sapi_apache2.c to zero it out there, instead of Zend/zend_alloc.c, since that's zeroing it before the apache variable is set. [2006-03-15 17:00:50] [EMAIL PROTECTED] That sounds like you're testing with 2.x. Apparently yes, sapi/apache2handler is for Apache2. My installation is 1.x. Then your report doesn't make any sense to me. You've said that it's fixed for Apache 1.x or what did you mean by that? The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/36724 -- Edit this bug report at http://bugs.php.net/?id=36724edit=1