[PATCH] FastCGI exits immediately with status 255
| Bug #26758 | [PATCH] FastCGI exits immediately with status 255 | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2003-12-31 20:50 UTC | Modified: | 2004-02-09 19:23 UTC |
|
||||||||||
| From: | tcarter at noggin dot com dot au | Assigned: | ||||||||||||
| Status: | Closed | Package: | CGI/CLI related | |||||||||||
| PHP Version: | 5CVS, 4CVS | OS: | Linux | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2003-12-31 20:50 UTC] tcarter at noggin dot com dot au
Description:
------------
When launched from mod_fastcgi as a dynamic application
the FastCGI binary exits with status 255 without serving
any requests. The problem is present in the latest CVS,
but not present in v4.3.4. The problem does not occur
when running the FastCGI binary with a bindpath (-b)
option.
The problem seems to be that
php_handle_aborted_connection() is called from the parent
process in sapi_cgi_bin_flush() and zend_bailout() then
exits because there is no bailout address set.
Webserver is:
Apache 2.0.47 (Fedora Core 1)
mod_fastcgi 2.4.2
PHP Configuration is just:
./configure --enable-fastcgi
The following seems to fix the problem, but I'm not sure
it is the right way to fix it:
--- cgi_main.c.bak 2004-01-01 12:38:22.000000000
+1100
+++ cgi_main.c 2004-01-01 12:39:34.000000000 +1100
@@ -271,7 +271,7 @@
#if PHP_FASTCGI
if (!FCGX_IsCGI()) {
FCGX_Request *request = (FCGX_Request
*)server_context;
- if(!request || FCGX_FFlush( request->out )
== -1 ) {
+ if( !parent && (!request ||
FCGX_FFlush( request->out ) == -1) ) {
php_handle_aborted_connection();
}
return;
Expected result:
----------------
PHP should serve requests and not exit immediately
Actual result:
--------------
[Thu Jan 01 12:22:54 2004] [warn] FastCGI: scheduled the
start of the last (dynamic) server
"/var/www/fastcgi-bin/php-5" process: reached
dynamicMaxClassProcs (1)
[Thu Jan 01 12:22:54 2004] [warn] FastCGI: (dynamic)
server "/var/www/fastcgi-bin/php-5" started (pid 17770)
[Thu Jan 01 12:22:54 2004] [warn] FastCGI: (dynamic)
server "/var/www/fastcgi-bin/php-5" (pid 17770) terminated
by calling exit with status '255'
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2004-01-02 17:09 UTC] pmoor at netpeople dot ch
[2004-02-04 10:50 UTC] bernhard dot fuerst at skallid dot com
[2004-02-09 19:23 UTC] iliaa@php.net