CGI SAPI does not shut down cleanly with -i/-m/-v cmdline options
| Bug #42453 | CGI SAPI does not shut down cleanly with -i/-m/-v cmdline options | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2007-08-28 09:14 UTC | Modified: | 2007-08-31 12:18 UTC |
|
||||||||||
| From: | hans at parse dot nl | Assigned: | dmitry (profile) | |||||||||||
| Status: | Closed | Package: | CGI/CLI related | |||||||||||
| PHP Version: | 5.2.4RC3 | OS: | Linux | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2007-08-28 09:14 UTC] hans at parse dot nl
Description:
------------
The CGI SAPI initializes extensions through the regular MINIT/RINIT functions, but lacks a call to php_request_shutdown() for proper extension shutdown on some command line options. This is the case for command line options -v, -i and -m, which call exit(0) without requesting module/extension shutdown first.
The CLI SAPI *does* clean up nicely after -v/-i/-m and does not exhibit this behavior.
Reproduce code:
---------------
With CGI SAPI:
# php-cgi -v
PHP 5.2.4RC3 (cgi-fcgi) (built: Aug 27 2007 16:51:33)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with eAccelerator v0.9.6-dev, Copyright (c) 2004-2007 eAccelerator, by eAccelerator
[23661] EACCELERATOR: PHP unclean shutdown
With CLI SAPI:
# php -v
PHP 5.2.4RC3 (cli) (built: Aug 27 2007 16:51:49)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with eAccelerator v0.9.6-dev, Copyright (c) 2004-2007 eAccelerator, by eAccelerator
Expected result:
----------------
nice clean shutdown through RSHUTDOWN/MSHUTDOWN.
Actual result:
--------------
exit(0) without shutting down modules/extensions
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2007-08-28 11:31 UTC] scottmac@php.net
[2007-08-28 11:46 UTC] jani@php.net
[2007-08-31 12:18 UTC] dmitry@php.net