#38435 [Opn->Asn]: PHP FastCGI dies with segmentation fault wgen the HTTP clients aborts the conn
| From: | iliaa@php.net | Date: | Sun, 13 Aug 2006 15:03:47 +0000 |
| Subject: | #38435 [Opn->Asn]: PHP FastCGI dies with segmentation fault wgen the HTTP clients aborts the conn | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-100736@lists.php.net to get a copy of this message | ||
ID: 38435
Updated by: iliaa@php.net
Reported By: pts at fazekas dot hu
-Status: Open
+Status: Assigned
Bug Type: Output Control
Operating System: Linux 2.6
PHP Version: 5.1.4
-Assigned To:
+Assigned To: dmitry
Previous Comments:
------------------------------------------------------------------------
[2006-08-12 14:05:52] pts at fazekas dot hu
Description:
------------
The FastCGI process dies (SIGSEGV) when the HTTP client aborts the
connection, but PHP wants to echo() more. The ignore_user_abort() state
doesn't matter, PHP dies anyway. See the code below.
To reproduce it, run wget http://.../code_below.php, and
abort wget
with Ctrl-<C>. See the Apache error log for the error message.
I think this is a serious bug that prevents normal use of PHP FastCGI.
Reproduce code:
---------------
<?php
# PHP 5.1.4 and PHP 4.3.10 are both affected with Apache 1.3.33 +
FastCGI
# vvv from Apache error log:
# [Sat Aug 12 15:50:40 2006] [warn] FastCGI: (dynamic) server
"/foo/php-cgi" (pid 3279) terminated due to uncaught signal '11'
(Segmentation fault)
# [Sat Aug 12 15:50:40 2006] [warn] FastCGI: (dynamic) server
"/foo/php-cgi" restarted (pid 3284)
function foo() {
}
register_shutdown_function('foo');
ignore_user_abort(TRUE);
#ignore_user_abort(FALSE); # Dat: this doesn't help either
# phpinfo(); exit;
$A="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
$A.=$A; $A.=$A; $A.=$A; $A.=$A; $A.=$A; $A.=$A;
$str=".$A";
for ($I=1; $I<1000; $I++) {
echo $str;
#sleep(1); # this doesn't prevent the bug, only delays it
}
Expected result:
----------------
The PHP FastCGI process should continue running and wait for more
requests.
Actual result:
--------------
The PHP FastCGI process dies with SIGSEGV (Segmentation fault, signal
11).
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38435&edit=1