ID: 36455
Updated by: [EMAIL PROTECTED]
Reported By: haleden at colorado dot edu
-Status: Open
+Status: Bogus
Bug Type: Apache related
Operating System: redhat 7
PHP Version: 5.1.2
New Comment:
>in what universe is it okay to have an unchecked recursive
> call to yourself and expect reasonable behavior?
In my universe this problem is not reproducible with any Apache & PHP
version I have.
Since you don't want to try to upgrade Apache -> bogus.
Previous Comments:
------------------------------------------------------------------------
[2006-02-22 17:53:15] haleden at colorado dot edu
maybe they never stop their server or later version of
apache don't properly call shutdown--i don't know.
i don't need to upgrade my server because fixing the obvious
bug gets rid of the problem. (in what universe is it okay to
have an unchecked recursive call to yourself and expect
reasonable behavior?)
to reproduce the problem:
apachectl stop
apachectl start
ps -auxwww|grep httpd --> no httpd processes
httpd -X
(segment violation, core dumped)
gdb httpd core
...
where
php_apache_shutdown_wrapper()
php_apache_shutdown_wrapper()
php_apache_shutdown_wrapper()
php_apache_shutdown_wrapper()
php_apache_shutdown_wrapper()
php_apache_shutdown_wrapper()
php_apache_shutdown_wrapper()
...
------------------------------------------------------------------------
[2006-02-22 08:46:22] [EMAIL PROTECTED]
Works perfectly fine for me and N millions of PHP users.
Apache 1.3.27 is very old, try to upgrade it first.
And decribe in details what exactly did you do to reproduce it.
------------------------------------------------------------------------
[2006-02-19 21:03:48] haleden at colorado dot edu
oops, forgot to say that the changes go in:
sapi/apache/mod_php5.c
...
int php_apache_shutdown_wrapper(void)
{
apache_php_initialized = 0;
/* apache_sapi_module.shutdown(&apache_sapi_module);*/
php_apache_request_shutdown(&apache_sapi_module);
...
------------------------------------------------------------------------
[2006-02-19 20:54:47] haleden at colorado dot edu
Description:
------------
there are a bunch of reports out there that have been
labeled "bogus" that i bet were not.
i began to have problems starting apache 1.3.27 reliably
after installing the php module.
i found that if i commented out the php module, apache would
start. then, if i went in and uncommented the php module,
and did a apachectl restart, things were fine.
i finally got some time to dig deeper, and ran it under gdb
and found that it was crashing in a deep stack of nested
calls to php_apache_shutdown_wrapper.
looking at the source, i see that
php_apache_shutdown_wrapper calls
apache_sapi_module.shutdown which is defined to be
php_apache_shutdown_wrapper. i suspect that at one time
apache_sapi_module.shutdown pointed to
php_apache_request_shutdown and things worked until someone
decided that the wrapper should be called but forgot to
change the wrapper to call php_apache_request_shutdown.
as to why it was happening at startup, i conjecture that
apache keeps track of modules in some way and if a module
didn't shutdown cleanly before, it calls the shutdown hook
to clean up before starting again. by starting it without
the module, that check was cleared, and it would not run the
shutdown hook the next time.
i'm not an expert at all of this stuff, but i made the
change to the wrapper and it seems to work--further testing
and sanity checking advised.
thanks,
hal
Reproduce code:
---------------
see above description for apache config changes
Expected result:
----------------
apache starts sucessfully each time when php module defined
Actual result:
--------------
apache doesn't always start successfully when php module
defined
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36455&edit=1