php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39330 apache2handler does not call shutdown actions before apache child die
Submitted: 2006-11-01 13:16 UTC Modified: 2007-06-01 10:04 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: isk at ecommerce dot com Assigned: tony2001
Status: Closed Package: Apache2 related
PHP Version: 5.1.6 OS: Linux
Private report: No CVE-ID:
 [2006-11-01 13:16 UTC] isk at ecommerce dot com
Description:
------------
apache2handler sapi registers cleanup functions only for 
main apache process.

php_apache_server_startup(){
...
apr_pool_cleanup_register(pconf, NULL, 
php_apache_server_shutdown, apr_pool_cleanup_null);
...
}

The pconf is main apache process pool. But apache 2 cleans 
_only_ child pool before it die.

apache2handler must register cleanup function and for 
child pool. This can be fixed by several strings.

sapi/apache2handler/sapi_apache2.c:
static void php_apache_child_init(apr_pool_t *pchild, 
server_rec *s)
{
  apr_pool_cleanup_register(pchild, NULL, 
php_apache_server_shutdown, apr_pool_cleanup_null);
}
void php_ap2_register_hook(apr_pool_t *p)
{
...
  ap_hook_child_init(php_apache_child_init, NULL, NULL, 
APR_HOOK_MIDDLE);
}


Without this code the using persistent connection has 
problem in unclean close connection to DB after apache 
child die.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-31 11:40 UTC] tony2001@php.net
I'll commit the patch after 5.2.3 release.
 [2007-05-31 11:44 UTC] gopalv@php.net
Bug confirmed and patch does work as said.
 [2007-06-01 10:04 UTC] tony2001@php.net
This bug has been fixed in CVS.

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.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 24 19:01:53 2014 UTC