php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51799 FPM crashes if the include is enabled, but there are no files
Submitted: 2010-05-12 15:57 UTC Modified: 2010-05-12 20:32 UTC
From: admin at saltwaterc dot net Assigned: fat
Status: Closed Package: FPM related
PHP Version: 5.3.2 OS: Linux
Private report: No CVE-ID:
 [2010-05-12 15:57 UTC] admin at saltwaterc dot net
Description:
------------
If the include configuration option is enabled, but the pool directory is empty, php-fpm crashes pretty ugly.

I could manage to enable the service by creating an empty default.conf file within the fpm.d directory, but obviously this isn't the solution. The used FPM is the latest trunk indicated by php-fpm.org http://svn.php.net/repository/php/php-src/trunk/sapi/fpm.

Test script:
---------------
The include line is:
include=/usr/local/zend/etc/fpm.d/*.conf

root@test-lucid:/usr/local/zend/etc/fpm.d# ls -la
total 8
drwxr-sr-x 2 root zend 4096 May 12 11:59 .
drwxrwsr-x 7 root zend 4096 May 12 11:59 ..
root@test-lucid:/usr/local/zend/etc/fpm.d#

Expected result:
----------------
To be able to start the php-fpm service just with the default pool from php-fpm.conf if fpm.d is empty. In my humble opinion the application shouldn't crash if no pattern is matched.

Actual result:
--------------
May 12 12:10:52.239695 [ERROR] Nothing match the include pattern '/usr/local/zend/etc/fpm.d/*.conf' from /usr/local/zend/etc/php-fpm.conf at line 10.

The backtrace is quite useless since the error is generated by sapi/fpm/fpm/fpm_conf.c, after the glob() call.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-12 18:03 UTC] fat@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: fat
 [2010-05-12 20:29 UTC] fat@php.net
Automatic comment from SVN on behalf of fat
Revision: http://svn.php.net/viewvc/?view=revision&revision=299302
Log: Fix #51799, when glob returns nothing, it was handle as an error instead of a warning.
 [2010-05-12 20:32 UTC] fat@php.net
-Status: Assigned +Status: Closed
 [2010-05-12 20:32 UTC] fat@php.net
This bug has been corrected in revision 299302.

When glob() returns GLOB_NOMATCH, the log message has been changed from ERROR to 
WARNING and FPM continues to parse the conf file without stopping.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 24 02:02:10 2014 UTC