Re: PHP 4.0 Bug #5102 : segfault on request shutdown
| From: | Khimenko Victor | Date: | Thu, 27 Jul 2000 15:17:22 +0000 |
| Subject: | Re: PHP 4.0 Bug #5102 : segfault on request shutdown | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-26487@lists.php.net to get a copy of this message | ||
In <Pine.LNX.4.21.0007271807440.22899-100000@mail.zend.com> Stanislav Malyshev (stas@zend.com)
wrote:
KV>>>
KV>>> Looks like I catched problem. It's in session.c handling of ini
KV>>> entries. There you have variables like entropy_file. Such
KV>>> variables are initialized TWICE! Once in
KV>>> PHP_MINIT_FUNCTION(session) (REGISTER_INI_ENTRIES(); is called
KV>>> there) and in php_rinit_session_globals... Deallocation is also
KV>>> done two times: in PHP_MSHUTDOWN_FUNCTION(session)
KV>>> (UNREGISTER_INI_ENTRIES(); is called there) and in
KV>>> php_rshutdown_session_globals... With this patch all works Ok
KV>>> (on first glance) but I'm not sure if it's correct fix: ---
SM> The weird thing here is that if it was just freed twice, it'd crash every
SM> time, but I never saw it crash in my setup. Why?
I've not investigated in deep (I had production server to be revived quick
after PHP 4.0b3 => PHP 4.0.1pl2 upgrade) but I know that it crashes ONLY when
I have something defined in php.ini : if value for entropy_file is not there
and default if used all works just fine without patch.
P.S. BTW if you looked on backtrace you'll find that I have libphp compiled
as shared library, mod_php4.so as Apache's DSO and session code as DSO as well.
May be this trigger something.
P.P.S. Oh, and since it carshes ONLY when request is served and page in
sent to browser this problem is usually not seen by users: pages are displayed
correctly and the only way to find out if something is wrong is via apache's
log. I've noted the problem only since I had PHP-script as subrequest
generated by mod_include : apache crashed before mod_include was able to
send text after included PHP-script ...