Bug #70538 [Opn->Csd]: "php-fpm -i" crashes

From: Date: Mon, 21 Sep 2015 03:20:24 +0000
Subject: Bug #70538 [Opn->Csd]: "php-fpm -i" crashes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196122@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 Updated by: laruence@php.net Reported by: rainer dot jung at kippdata dot de Summary: "php-fpm -i" crashes -Status: Open +Status: Closed Type: Bug Package: FPM related Operating System: Any PHP Version: 7.0.0RC3 Block user comment: N Private report: N New Comment: 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) Previous Comments: ------------------------------------------------------------------------ [2015-09-20 21:57:47] rainer dot jung at kippdata dot de The attached patch fixes it for me. ------------------------------------------------------------------------ [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

« previous php.bugs (#196122) next »