Edit report at http://bugs.php.net/bug.php?id=54924&edit=1
ID: 54924 Updated by: il...@php.net Reported by: andreas dot streichardt at gmail dot com Summary: assert.active is not being reset upon request shutdown -Status: Open +Status: Closed Type: Bug Package: Unknown/Other Function Operating System: Linux PHP Version: 5.3.6 -Assigned To: +Assigned To: iliaa Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2011-05-26 20:17:45] il...@php.net Automatic comment from SVN on behalf of iliaa Revision: http://svn.php.net/viewvc/?view=revision&revision=311451 Log: Fixed bug #54924 (assert.* is not being reset upon request shutdown). ------------------------------------------------------------------------ [2011-05-25 14:15:44] steemann at globalpark dot de Same issue for assert.warning (ASSERT_WARNING). The value is not reset to the ini setting value at the end of each request if PHP child processes are reused (e.g. in fastcgi mode). Probably the same for assert.bail and friends. ------------------------------------------------------------------------ [2011-05-25 13:48:50] andreas dot streichardt at gmail dot com Description: ------------ The assert related functions are saving their state in a global structure. The problem is that the assert state is not being reset in the RSHUTDOWN function and thus the assert state of the last request will be used for the next request. Example: If assert is active by default (php.ini assert.active) and you set it to false via assert_options this works fine. However on the next request the default will be that assert is not active. The fix is to add ASSERTG(active)=INI_INT("assert.active"); to asserts RSHUTDOWN function. I am using the FastCGI SAPI. Test script: --------------- var_dump(assert_options(ASSERT_ACTIVE)); assert(false); var_dump(assert_options(ASSERT_ACTIVE,1)); assert(false); var_dump(assert_options(ASSERT_ACTIVE,0)); assert(false); Expected result: ---------------- int(1) Warning: assert() [function.assert]: Assertion failed in xxx.php on line 3 int(1) Warning: assert() [function.assert]: Assertion failed in xxx.php on line 5 int(1) Actual result: -------------- First request: int(1) Warning: assert() [function.assert]: Assertion failed in xxx.php on line 3 int(1) Warning: assert() [function.assert]: Assertion failed in xxx.php on line 5 int(1) Second request (make sure you hit the same pid): int(0) int(0) Warning: assert() [function.assert]: Assertion failed in xxx.php on line 5 int(1) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=54924&edit=1