From: dmda at yandex dot ru Operating system: Windows XP sp3 PHP version: 5.3.0RC3 PHP Bug Type: Reproducible crash Bug description: # in php.ini will cause php to crash if latter is running in FastCGI mode
Description: ------------ A line in php.ini commented with # character will cause php to crash at the following line: cgi_main.c:686 static void sapi_cgi_log_message(char *message) { TSRMLS_FETCH(); if (fcgi_is_fastcgi() && CGIG(fcgi_logging)) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ It happens only if PHP is running in FastCGI mode (so fcgi_is_fastcgi() returns true). In this case, any commented lines or any other "deprected" errors will call zend_error handler and subsiquently sapi_cgi_log_message() at the time when CGIG() is not initialized, yet. Call stack: sapi_cgi_log_message(char * 0x011a23d8) line 686 + 30 bytes php_log_err(char * 0x011a23d8, void * * * 0x00332688) line 557 + 10 bytes php_error_cb(int 8192, const char * 0x10401944 `string', const unsigned int 0, const char * 0x1040bc70 `string', char * 0x00c0c9b4) line 951 + 13 bytes zend_error(int 8192, const char * 0x1040bc70 `string') line 1020 + 26 bytes ini_lex(_zval_struct * 0x00c0cadc, void * * * 0x00332688) line 491 + 47 bytes ini_parse(void * 0x00332688) line 1557 + 16 bytes zend_parse_ini_file(_zend_file_handle * 0x00c0db58, unsigned char 1, int 0, void (_zval_struct *, _zval_struct *, _zval_struct *, int, void *, void * * *)* 0x100e4874 php_ini_parser_cb(_zval_struct *, _zval_struct *, _zval_struct *, int, _hashtable *), void * 0x105e0de0 configuration_hash, void * * * 0x00332688) line 319 + 9 bytes php_init_config(void * * * 0x00332688) line 587 + 27 bytes php_module_startup(_sapi_module_struct * 0x0040b018 cgi_sapi_module, _zend_module_entry * 0x0040b0b0 cgi_module_entry, unsigned int 1) line 1911 + 9 bytes php_cgi_startup(_sapi_module_struct * 0x0040b018 cgi_sapi_module) line 830 + 17 bytes main(int 1, char * * 0x00333fa0) line 1573 + 11 bytes PHP-CGI! mainCRTStartup + 227 bytes Reproduce code: --------------- no code/any code Expected result: ---------------- no crash Actual result: -------------- access violation -- Edit bug report at http://bugs.php.net/?id=48563&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48563&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48563&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48563&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=48563&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48563&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=48563&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=48563&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=48563&r=needscript Try newer version: http://bugs.php.net/fix.php?id=48563&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=48563&r=support Expected behavior: http://bugs.php.net/fix.php?id=48563&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=48563&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=48563&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=48563&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48563&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=48563&r=dst IIS Stability: http://bugs.php.net/fix.php?id=48563&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=48563&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=48563&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=48563&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=48563&r=mysqlcfg