php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70538 "php-fpm -i" crashes
Submitted: 2015-09-20 21:50 UTC Modified: -
From: rainer dot jung at kippdata dot de Assigned:
Status: Closed Package: FPM related
PHP Version: 7.0.0RC3 OS: Any
Private report: No CVE-ID: None
 [2015-09-20 21:50 UTC] rainer dot jung at kippdata dot de
Description:
------------
Executing "php-fpm -i" crashes. This is due to the commit abb616ae which is a merge of the cgi commit 6bc16cce to fpm.

The crash happens, because in sapi/fpm/fpm/fpm_main.c in function sapi_cgi_register_variables() the variable request is NULL in line

char *path_info = FCGI_GETENV(request, "PATH_INFO");

Before the merge the line was

char *path_info = sapi_cgibin_getenv("PATH_INFO", sizeof("PATH_INFO") - 1);

and sapi_cgibin_getenv() falls back to simple getenv() if request is NULL (and also if fpm_is_running is not set. The original change in cgi should not have this problem, only the port to fpm can execute "phpinfo" without actually running a real request.

I'll try if it is enough to simply change the one line back for a fix, or if the crash then moves to a later place in code and more work needs to be done.

Test script:
---------------
Run php-fpm -i


Patches

fpm-info-crash (last revision 2015-09-20 21:57 UTC by rainer dot jung at kippdata dot de)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-09-20 21:57 UTC] rainer dot jung at kippdata dot de
The attached patch fixes it for me.
 [2015-09-21 03:20 UTC] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=85eece9c4fab08cc73f09f5bb67c3a2752b746b2
Log: Fixed bug #70538 ("php-fpm -i" crashes)
 [2015-09-21 03:20 UTC] laruence@php.net
-Status: Open +Status: Closed
 [2015-09-21 03:20 UTC] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=a247c3a27df89a9839c8d87d66173f4f59873d3a
Log: Fixed bug #70538 ("php-fpm -i" crashes)
 [2015-09-21 03:20 UTC] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=85eece9c4fab08cc73f09f5bb67c3a2752b746b2
Log: Fixed bug #70538 ("php-fpm -i" crashes)
 [2015-09-21 03:20 UTC] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=a247c3a27df89a9839c8d87d66173f4f59873d3a
Log: Fixed bug #70538 ("php-fpm -i" crashes)
 [2015-09-29 13:10 UTC] ab@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=85eece9c4fab08cc73f09f5bb67c3a2752b746b2
Log: Fixed bug #70538 ("php-fpm -i" crashes)
 [2015-09-29 13:10 UTC] ab@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=a247c3a27df89a9839c8d87d66173f4f59873d3a
Log: Fixed bug #70538 ("php-fpm -i" crashes)
 [2016-07-20 11:36 UTC] davey@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=85eece9c4fab08cc73f09f5bb67c3a2752b746b2
Log: Fixed bug #70538 ("php-fpm -i" crashes)
 [2016-07-20 11:36 UTC] davey@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=a247c3a27df89a9839c8d87d66173f4f59873d3a
Log: Fixed bug #70538 ("php-fpm -i" crashes)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 04:01:31 2024 UTC