#34176 [Fbk->Opn]: apache2handler crashes parent process if child process dies
| From: | robert at rw-it dot net | Date: | Sat, 20 Aug 2005 13:17:00 +0000 |
| Subject: | #34176 [Fbk->Opn]: apache2handler crashes parent process if child process dies | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-83826@lists.php.net to get a copy of this message | ||
ID: 34176
User updated by: robert at rw-it dot net
Reported By: robert at rw-it dot net
-Status: Feedback
+Status: Open
Bug Type: Apache2 related
Operating System: Win32
PHP Version: 4.4.0
New Comment:
Seems to be fixed in php5-win32-latest (that is, built August 9th
2005). Will this be fixed in php4, too?
Previous Comments:
------------------------------------------------------------------------
[2005-08-18 02:41:46] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
------------------------------------------------------------------------
[2005-08-17 19:31:51] robert at rw-it dot net
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 this bug report at http://bugs.php.net/?id=34176&edit=1