php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38435 PHP FastCGI dies with segmentation fault wgen the HTTP clients aborts the conn
Submitted: 2006-08-12 14:05 UTC Modified: 2006-08-22 01:00 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: pts at fazekas dot hu Assigned: dmitry (profile)
Status: No Feedback Package: CGI/CLI related
PHP Version: 5.1.4 OS: Linux 2.6
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
39 - 7 = ?
Subscribe to this entry?

 
 [2006-08-12 14:05 UTC] 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).

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-14 09:34 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2006-08-22 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 11:01:28 2024 UTC