From: robert at rw-it dot net Operating system: Win32 PHP version: 4.4.0 PHP Bug Type: Apache2 related Bug description: apache2handler crashes parent process if child process dies
Description: ------------ Using mpm_winnt, if the child process dies, some of the php_apache_sapi_* functions seem to be called with SG(server_context) == NULL. This (sometimes??) results in crashing the parent process. I added a check for SG(server_context) == NULL to each function and the problem went away, but perhaps you could think of a better solution. Reproduce code: --------------- Write a script that crashes the child process. E.g. disable memory_limit and do for ($b = 'x'; ; $b .= $b); I also once inserted an exit(1) into apache's child.c with the same results, but doing it via PHP seems more realistic. Try to load the page a few times. Expected result: ---------------- Apache restarts the child process. Actual result: -------------- Sometimes it does, sometimes it crashes... ratio is about 2/3. When it crashes, the cause is an access to memory at address 0x0 or 0x4, in php4apache2.dll. Looking at the local variables, it appears that SG(server_context) is NULL. I was not able to reproduce a crash after I added checks for SG(server_context) == NULL to sapi_apache2.c. -- Edit bug report at http://bugs.php.net/?id=34176&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34176&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34176&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34176&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34176&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34176&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34176&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34176&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34176&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34176&r=support Expected behavior: http://bugs.php.net/fix.php?id=34176&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34176&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34176&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34176&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34176&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34176&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34176&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34176&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34176&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34176&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34176&r=mysqlcfg