|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-06-15 20:07 UTC] dmda at yandex dot ru
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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 16:00:01 2025 UTC |
yes, I know this and pointed to this fact in PHPCON 2003. Anyway the trouble manifests itself. As far as I understand, the problem is with initialization of the module context. It is not done at the moment when php core logs the error in php.ini ("deprecated stuff" in this case). If I'm correct, initialization is initialization. NTS won't crash just because it does not allocate its context in the heap because it uses static data. Even if it works foryou, uninitialized data won't let you control the values. You either can not get the error in php's log or can't stop it from appearing. Try to change fcgi_logging value (fastcgi.logging = ON and OFF) and see if the error appears or does not appear respectively.