Bug #70538 [Com]: "php-fpm -i" crashes
| From: | rainer dot jung at kippdata dot de | Date: | Sun, 20 Sep 2015 21:57:48 +0000 |
| Subject: | Bug #70538 [Com]: "php-fpm -i" crashes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-196121@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70538&edit=1
ID: 70538
Comment by: rainer dot jung at kippdata dot de
Reported by: rainer dot jung at kippdata dot de
Summary: "php-fpm -i" crashes
Status: Open
Type: Bug
Package: FPM related
Operating System: Any
PHP Version: 7.0.0RC3
Block user comment: N
Private report: N
New Comment:
The attached patch fixes it for me.
Previous Comments:
------------------------------------------------------------------------
[2015-09-20 21:50:10] 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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70538&edit=1