#27810 [Csd]: Apache-2.0.49 crashes on graceful/restart
ID: 27810 User updated by: renato at galle dot com dot br Reported By: renato at galle dot com dot br Status: Closed Bug Type: Apache2 related Operating System: FreeBSD-5.2.1-RELEASE-p4 PHP Version: 4.3.5 New Comment: Here is the patch to fix it on php-4.3.6: --- ext/pcre/php_pcre.c.origFri Apr 16 09:21:14 2004 +++ ext/pcre/php_pcre.c Fri Apr 16 09:23:36 2004 @@ -106,15 +106,6 @@ REGISTER_LONG_CONSTANT(PREG_SPLIT_DELIM_CAPTURE, PREG_SPLIT_DELIM_CAPTURE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(PREG_SPLIT_OFFSET_CAPTURE, PREG_SPLIT_OFFSET_CAPTURE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(PREG_GREP_INVERT, PREG_GREP_INVERT, CONST_CS | CONST_PERSISTENT); - - pcre_malloc = php_pcre_malloc; - pcre_free = php_pcre_free; - -#ifdef NO_RECURSE - pcre_stack_malloc = php_pcre_malloc; - pcre_stack_free = php_pcre_free; -#endif - return SUCCESS; } /* }}} */ @@ -130,6 +121,16 @@ } /* }}} */ +/* {{{ PHP_RINIT_FUNCTION(pcre) */ +static PHP_RINIT_FUNCTION(pcre) +{ + pcre_malloc = php_pcre_malloc; + pcre_free = php_pcre_free; + + return SUCCESS; +} +/* }}} */ + /* {{{ pcre_get_compiled_regex */ PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options) { @@ -1527,7 +1528,7 @@ pcre_functions, PHP_MINIT(pcre), PHP_MSHUTDOWN(pcre), - NULL, + PHP_RINIT(pcre), NULL, PHP_MINFO(pcre), NO_VERSION_YET, Previous Comments: [2004-04-19 19:09:19] renato at galle dot com dot br Here is the patch to fix it on php-4.3.6: --- ext/pcre/php_pcre.c.origFri Apr 16 09:21:14 2004 +++ ext/pcre/php_pcre.c Fri Apr 16 09:23:36 2004 @@ -106,15 +106,6 @@ REGISTER_LONG_CONSTANT(PREG_SPLIT_DELIM_CAPTURE, PREG_SPLIT_DELIM_CAPTURE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(PREG_SPLIT_OFFSET_CAPTURE, PREG_SPLIT_OFFSET_CAPTURE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(PREG_GREP_INVERT, PREG_GREP_INVERT, CONST_CS | CONST_PERSISTENT); - - pcre_malloc = php_pcre_malloc; - pcre_free = php_pcre_free; - -#ifdef NO_RECURSE - pcre_stack_malloc = php_pcre_malloc; - pcre_stack_free = php_pcre_free; -#endif - return SUCCESS; } /* }}} */ @@ -130,6 +121,16 @@ } /* }}} */ +/* {{{ PHP_RINIT_FUNCTION(pcre) */ +static PHP_RINIT_FUNCTION(pcre) +{ + pcre_malloc = php_pcre_malloc; + pcre_free = php_pcre_free; + + return SUCCESS; +} +/* }}} */ + /* {{{ pcre_get_compiled_regex */ PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options) { @@ -1527,7 +1528,7 @@ pcre_functions, PHP_MINIT(pcre), PHP_MSHUTDOWN(pcre), - NULL, + PHP_RINIT(pcre), NULL, PHP_MINFO(pcre), NO_VERSION_YET, [2004-04-19 18:40:56] remco at linux-adept dot nl Using PHP 4.3.5 or 4.3.6 crashes my Apache 2.0.49 doing a 'apachectl graceful'. Which is a kill for logrotation! Everything was fine untill 4.3.5 came along. Changing back to 4.3.4 solves the problem. I have tried recompiling apache etc. Nothing helps. Gracefully restarting apache gives the following in the error-logs: [Mon Apr 19 18:28:10 2004] [notice] Graceful restart requested, doing restart [Mon Apr 19 18:28:10 2004] [notice] seg fault or similar nasty error detected in the parent process And apache has to be restarted once more to get it running. [2004-04-16 11:28:38] noackjr at alumni dot rice dot edu Bless you -- the FreeBSD port works flawlessly for me now. [2004-04-16 07:46:13] ale at FreeBSD dot org Hopefully fixed in php port with this patch: http://www.freebsd.org/cgi/cvsweb.cgi/ports/lang/php4/files/patch-ext%3a%3apcre%3a%3aphp_pcre.c?rev=1.1content-type=text/x-cvsweb-markup [2004-04-16 03:35:45] towerofpower at operamail dot com You might want to take a look at... http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20462 http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17055 This seems very similar. Apache 2.0.49, mod_ssl (OpenSSL 0.9.7d), PHP 4.3.6, mod_perl 1.99_13, mod_delfate (zlib 1.1.4), perl 5.8.3 Built with VS.NET 2002 under Win2k, SP4 (except PHP 4.3.6 -- official binary) After 'net stop Apache2'... Apache.exe - Application Error The instruction at 0x77f92373 referenced memory at 0x0010. The memory could not be written. We do have a workaround for this problem: set LogLevel under httpd.conf from warn to error (this only works for a select set of versions of Apache and PHP
#27810 [Csd]: Apache-2.0.49 crashes on graceful/restart
ID: 27810 User updated by: renato at galle dot com dot br Reported By: renato at galle dot com dot br Status: Closed Bug Type: Apache2 related Operating System: FreeBSD-5.2.1-RELEASE-p4 PHP Version: 4.3.5 New Comment: Here is the patch to fix it on php-4.3.6: --- ext/pcre/php_pcre.c.origFri Apr 16 09:21:14 2004 +++ ext/pcre/php_pcre.c Fri Apr 16 09:23:36 2004 @@ -106,15 +106,6 @@ REGISTER_LONG_CONSTANT(PREG_SPLIT_DELIM_CAPTURE, PREG_SPLIT_DELIM_CAPTURE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(PREG_SPLIT_OFFSET_CAPTURE, PREG_SPLIT_OFFSET_CAPTURE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(PREG_GREP_INVERT, PREG_GREP_INVERT, CONST_CS | CONST_PERSISTENT); - - pcre_malloc = php_pcre_malloc; - pcre_free = php_pcre_free; - -#ifdef NO_RECURSE - pcre_stack_malloc = php_pcre_malloc; - pcre_stack_free = php_pcre_free; -#endif - return SUCCESS; } /* }}} */ @@ -130,6 +121,16 @@ } /* }}} */ +/* {{{ PHP_RINIT_FUNCTION(pcre) */ +static PHP_RINIT_FUNCTION(pcre) +{ + pcre_malloc = php_pcre_malloc; + pcre_free = php_pcre_free; + + return SUCCESS; +} +/* }}} */ + /* {{{ pcre_get_compiled_regex */ PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options) { @@ -1527,7 +1528,7 @@ pcre_functions, PHP_MINIT(pcre), PHP_MSHUTDOWN(pcre), - NULL, + PHP_RINIT(pcre), NULL, PHP_MINFO(pcre), NO_VERSION_YET, Previous Comments: [2004-04-19 19:09:19] renato at galle dot com dot br Here is the patch to fix it on php-4.3.6: --- ext/pcre/php_pcre.c.origFri Apr 16 09:21:14 2004 +++ ext/pcre/php_pcre.c Fri Apr 16 09:23:36 2004 @@ -106,15 +106,6 @@ REGISTER_LONG_CONSTANT(PREG_SPLIT_DELIM_CAPTURE, PREG_SPLIT_DELIM_CAPTURE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(PREG_SPLIT_OFFSET_CAPTURE, PREG_SPLIT_OFFSET_CAPTURE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT(PREG_GREP_INVERT, PREG_GREP_INVERT, CONST_CS | CONST_PERSISTENT); - - pcre_malloc = php_pcre_malloc; - pcre_free = php_pcre_free; - -#ifdef NO_RECURSE - pcre_stack_malloc = php_pcre_malloc; - pcre_stack_free = php_pcre_free; -#endif - return SUCCESS; } /* }}} */ @@ -130,6 +121,16 @@ } /* }}} */ +/* {{{ PHP_RINIT_FUNCTION(pcre) */ +static PHP_RINIT_FUNCTION(pcre) +{ + pcre_malloc = php_pcre_malloc; + pcre_free = php_pcre_free; + + return SUCCESS; +} +/* }}} */ + /* {{{ pcre_get_compiled_regex */ PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options) { @@ -1527,7 +1528,7 @@ pcre_functions, PHP_MINIT(pcre), PHP_MSHUTDOWN(pcre), - NULL, + PHP_RINIT(pcre), NULL, PHP_MINFO(pcre), NO_VERSION_YET, [2004-04-19 18:40:56] remco at linux-adept dot nl Using PHP 4.3.5 or 4.3.6 crashes my Apache 2.0.49 doing a 'apachectl graceful'. Which is a kill for logrotation! Everything was fine untill 4.3.5 came along. Changing back to 4.3.4 solves the problem. I have tried recompiling apache etc. Nothing helps. Gracefully restarting apache gives the following in the error-logs: [Mon Apr 19 18:28:10 2004] [notice] Graceful restart requested, doing restart [Mon Apr 19 18:28:10 2004] [notice] seg fault or similar nasty error detected in the parent process And apache has to be restarted once more to get it running. [2004-04-16 11:28:38] noackjr at alumni dot rice dot edu Bless you -- the FreeBSD port works flawlessly for me now. [2004-04-16 07:46:13] ale at FreeBSD dot org Hopefully fixed in php port with this patch: http://www.freebsd.org/cgi/cvsweb.cgi/ports/lang/php4/files/patch-ext%3a%3apcre%3a%3aphp_pcre.c?rev=1.1content-type=text/x-cvsweb-markup [2004-04-16 03:35:45] towerofpower at operamail dot com You might want to take a look at... http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20462 http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17055 This seems very similar. Apache 2.0.49, mod_ssl (OpenSSL 0.9.7d), PHP 4.3.6, mod_perl 1.99_13, mod_delfate (zlib 1.1.4), perl 5.8.3 Built with VS.NET 2002 under Win2k, SP4 (except PHP 4.3.6 -- official binary) After 'net stop Apache2'... Apache.exe - Application Error The instruction at 0x77f92373 referenced memory at 0x0010. The memory could not be written. We do have a workaround for this problem: set LogLevel under httpd.conf from warn to error (this only works for a select set of versions of Apache and PHP
#27810 [NEW]: Apache-2.0.49 crashes on graceful/restart
From: renato at galle dot com dot br Operating system: FreeBSD-5.2.1-RELEASE-p4 PHP version: 4.3.5 PHP Bug Type: Apache2 related Bug description: Apache-2.0.49 crashes on graceful/restart Description: When compile php-4.3.5 with PCRE support with apache-2.0.49 and try to graceful or restart apache a signal 11 (core dumped) error occours. I move ext/pcre directory from php-4.3.4 to php-4.3.5 src directory and recompile, and all works fine. This problem occours on FreeBSD: http://www.freebsd.org/cgi/query-pr.cgi?pr=64904 on Linux: http://bugs.php.net/bug.php?id=27735 and on Solaris 9: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=28086 To reproduce do this: - Install apache-2.0.49 - Compile php-4.3.5 with PCRE support using apxs - run apachectl start - run apachectl restart or apachectl graceful and apache will die Actual result: -- [EMAIL PROTECTED]:/usr/local# gdb /usr/local/sbin/httpd ./httpd.core GNU gdb 5.2.1 (FreeBSD) Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type show copying to see the conditions. There is absolutely no warranty for GDB. Type show warranty for details. This GDB was configured as i386-unknown-freebsd...(no debugging symbols found)... Core was generated by `httpd'. Program terminated with signal 11, Segmentation fault. Reading symbols from /lib/libz.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/libz.so.2 Reading symbols from /usr/lib/libssl.so.3...(no debugging symbols found)...done. Loaded symbols for /usr/lib/libssl.so.3 Reading symbols from /lib/libcrypto.so.3...(no debugging symbols found)...done. Loaded symbols for /lib/libcrypto.so.3 Reading symbols from /usr/local/lib/apache2/libaprutil-0.so.9...(no debugging symbols found)...done. Loaded symbols for /usr/local/lib/apache2/libaprutil-0.so.9 Reading symbols from /usr/local/lib/libexpat.so.5...(no debugging symbols found)...done. Loaded symbols for /usr/local/lib/libexpat.so.5 Reading symbols from /usr/local/lib/apache2/libapr-0.so.9...(no debugging symbols found)...done. Loaded symbols for /usr/local/lib/apache2/libapr-0.so.9 Reading symbols from /lib/libm.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/libm.so.2 Reading symbols from /lib/libcrypt.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/libcrypt.so.2 Reading symbols from /lib/libc.so.5...(no debugging symbols found)...done. Loaded symbols for /lib/libc.so.5 Reading symbols from /usr/local/libexec/apache2/mod_access.so...(no debugging symbols found)...done. Loaded symbols for /usr/local/libexec/apache2/mod_access.so Reading symbols from /usr/local/libexec/apache2/mod_auth.so...(no debugging symbols found)...done. Loaded symbols for /usr/local/libexec/apache2/mod_auth.so Reading symbols from /usr/local/libexec/apache2/mod_auth_anon.so...(no debugging symbols found)...done. Loaded symbols for /usr/local/libexec/apache2/mod_auth_anon.so Reading symbols from /usr/local/libexec/apache2/mod_auth_dbm.so...(no debugging symbols found)...done. Loaded symbols for /usr/local/libexec/apache2/mod_auth_dbm.so Reading symbols from /usr/local/libexec/apache2/mod_include.so...(no debugging symbols found)...done. Loaded symbols for /usr/local/libexec/apache2/mod_include.so Reading symbols from /usr/local/libexec/apache2/mod_deflate.so...(no debugging symbols found)...done. Loaded symbols for /usr/local/libexec/apache2/mod_deflate.so Reading symbols from /usr/local/libexec/apache2/mod_log_config.so...(no debugging symbols found)...done. Loaded symbols for /usr/local/libexec/apache2/mod_log_config.so Reading symbols from /usr/local/libexec/apache2/mod_env.so...(no debugging symbols found)...done. Loaded symbols for /usr/local/libexec/apache2/mod_env.so Reading symbols from /usr/local/libexec/apache2/mod_mime_magic.so...(no debugging symbols found)...done. Loaded symbols for /usr/local/libexec/apache2/mod_mime_magic.so Reading symbols from /usr/local/libexec/apache2/mod_cern_meta.so...(no debugging symbols found)...done. Loaded symbols for /usr/local/libexec/apache2/mod_cern_meta.so Reading symbols from /usr/local/libexec/apache2/mod_expires.so...(no debugging symbols found)...done. Loaded symbols for /usr/local/libexec/apache2/mod_expires.so Reading symbols from /usr/local/libexec/apache2/mod_headers.so...(no debugging symbols found)...done. Loaded symbols for /usr/local/libexec/apache2/mod_headers.so Reading symbols from /usr/local/libexec/apache2/mod_usertrack.so...(no debugging symbols found)...done. Loaded symbols for /usr/local/libexec/apache2/mod_usertrack.so Reading symbols from /libexec/ld-elf.so.1...(no debugging symbols found)...done. Loaded symbols for /libexec/ld-elf.so.1 #0 0x2848bd90 in ?? () (gdb) bt #0 0x2848bd90 in ?? () #1