php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55340 FPM: SIGSEGV with some arguments
Submitted: 2011-08-01 22:21 UTC Modified: 2011-08-02 00:59 UTC
From: php-bugs at majkl578 dot cz Assigned: fat (profile)
Status: Closed Package: FPM related
PHP Version: 5.4SVN-2011-08-01 (snap) OS: Linux Debian Sid
Private report: No CVE-ID: None
 [2011-08-01 22:21 UTC] php-bugs at majkl578 dot cz
Description:
------------
Segmentation fault when used with some arguments.

Test script:
---------------
$ php-fpm -h
$ php-fpm --help
$ php-fpm -v

And maybe some others.

Expected result:
----------------
Console output.

Actual result:
--------------
Core was generated by `php-fpm -h'.
Program terminated with signal 11, Segmentation fault.
#0  0x086aa5f4 in fcgi_write (req=0x0, type=FCGI_STDOUT, 
    str=0xb68ba064 "Usage: php [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-p <prefix>] [-g <pid>] [-c <file>] [-d foo[=bar]] [-y <file>]\n  -c <path>|<file> Look for php.ini file in this directory\n  -n", ' ' <repeats 15 times>, "No php.ini f"..., len=839) at /storage/builds/php/php5.4-201108010030/sapi/fpm/fpm/fastcgi.c:957
957		if (req->out_hdr && req->out_hdr->type != type) {
(gdb) bt
#0  0x086aa5f4 in fcgi_write (req=0x0, type=FCGI_STDOUT, 
    str=0xb68ba064 "Usage: php [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-p <prefix>] [-g <pid>] [-c <file>] [-d foo[=bar]] [-y <file>]\n  -c <path>|<file> Look for php.ini file in this directory\n  -n", ' ' <repeats 15 times>, "No php.ini f"..., len=839) at /storage/builds/php/php5.4-201108010030/sapi/fpm/fpm/fastcgi.c:957
#1  0x086b2689 in sapi_cgibin_single_write (
    str=0xb68ba064 "Usage: php [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-p <prefix>] [-g <pid>] [-c <file>] [-d foo[=bar]] [-y <file>]\n  -c <path>|<file> Look for php.ini file in this directory\n  -n", ' ' <repeats 15 times>, "No php.ini f"..., str_length=839)
    at /storage/builds/php/php5.4-201108010030/sapi/fpm/fpm/fpm_main.c:269
#2  0x086b26c4 in sapi_cgibin_ub_write (
    str=0xb68ba064 "Usage: php [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-p <prefix>] [-g <pid>] [-c <file>] [-d foo[=bar]] [-y <file>]\n  -c <path>|<file> Look for php.ini file in this directory\n  -n", ' ' <repeats 15 times>, "No php.ini f"..., str_length=839)
    at /storage/builds/php/php5.4-201108010030/sapi/fpm/fpm/fpm_main.c:283
#3  0x0853305c in php_output_op (op=0, 
    str=0xb68ba064 "Usage: php [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-p <prefix>] [-g <pid>] [-c <file>] [-d foo[=bar]] [-y <file>]\n  -c <path>|<file> Look for php.ini file in this directory\n  -n", ' ' <repeats 15 times>, "No php.ini f"..., len=839) at /storage/builds/php/php5.4-201108010030/main/output.c:1022
#4  0x08531321 in php_output_write (
    str=0xb68ba064 "Usage: php [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-p <prefix>] [-g <pid>] [-c <file>] [-d foo[=bar]] [-y <file>]\n  -c <path>|<file> Look for php.ini file in this directory\n  -n", ' ' <repeats 15 times>, "No php.ini f"..., len=839) at /storage/builds/php/php5.4-201108010030/main/output.c:201
#5  0x0851b47c in php_printf (
    format=0x8bb54b8 "Usage: %s [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-p <prefix>] [-g <pid>] [-c <file>] [-d foo[=bar]] [-y <file>]\n  -c <path>|<file> Look for php.ini file in this directory\n  -n", ' ' <repeats 15 times>, "No php.ini fi"...) at /storage/builds/php/php5.4-201108010030/main/main.c:607
#6  0x086b38c0 in php_cgi_usage (argv0=0xbf8f1c54 "php-fpm")
    at /storage/builds/php/php5.4-201108010030/sapi/fpm/fpm/fpm_main.c:854
#7  0x086b4ff3 in main (argc=2, argv=0xbf8f0004)
    at /storage/builds/php/php5.4-201108010030/sapi/fpm/fpm/fpm_main.c:1622


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-01 22:32 UTC] fat@php.net
-Assigned To: +Assigned To: fat
 [2011-08-01 23:20 UTC] fat@php.net
-Status: Assigned +Status: Analyzed
 [2011-08-01 23:20 UTC] fat@php.net
This bug has been caused by commit 313351 (http://svn.php.net/viewvc?
view=revision&revision=313351) which cause segfault when FPM outputs before 
fastcgi is initialized.

I'll fix it tomorrow.
 [2011-08-02 00:58 UTC] fat@php.net
Automatic comment from SVN on behalf of fat
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=314078
Log: - Fixed bug #55340 (segfault when using some arguments -- bug introduced by commit r313351)
 [2011-08-02 00:59 UTC] fat@php.net
-Status: Analyzed +Status: Closed
 [2011-08-02 00:59 UTC] fat@php.net
This bug has been fixed in SVN.

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/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2012-04-18 09:49 UTC] laruence@php.net
Automatic comment on behalf of fat
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3bd0db004e3d61db4ba1039ad71a03619ce69c92
Log: - Fixed bug #55340 (segfault when using some arguments -- bug introduced by commit r313351)
 [2012-07-24 23:40 UTC] rasmus@php.net
Automatic comment on behalf of fat
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3bd0db004e3d61db4ba1039ad71a03619ce69c92
Log: - Fixed bug #55340 (segfault when using some arguments -- bug introduced by commit r313351)
 [2013-11-17 09:37 UTC] laruence@php.net
Automatic comment on behalf of fat
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3bd0db004e3d61db4ba1039ad71a03619ce69c92
Log: - Fixed bug #55340 (segfault when using some arguments -- bug introduced by commit r313351)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 04 19:01:32 2024 UTC