ID: 27810 Comment by: danu at drydog dot com Reported By: renato at galle dot com dot br Status: Open Bug Type: Apache2 related Operating System: FreeBSD-5.2.1-RELEASE-p4 PHP Version: 4.3.5 New Comment:
I tried jorton's "alternative patch" with PHP 4.3.6 and Apache 2.0.49 (with SSL) on an otherwise standard RedHat 9 on Intel. I can confirm it works (that is, I can restart Apache) on 2 different systems. YEAH!!!!!! Previous to patching, it did not work (that is, Apache errored out with these messages in the Apache error log: [Wed Mar 31 17:14:43 2004] [notice] SIGHUP received. Attempting to restart [Wed Mar 31 17:14:43 2004] [notice] seg fault or similar nasty error detected in the parent process [Wed Mar 31 17:14:48 2004] [warn] pid file /var/run/httpd.pid overwritten -- Unclean shutdown of previous Apache run? Previous Comments: ------------------------------------------------------------------------ [2004-04-22 00:26:07] jorton at redhat dot com Can you try this alternative patch: http://www.apache.org/~jorton/php-4.3.6-pcrealloc.patch ------------------------------------------------------------------------ [2004-04-21 15:58:16] php dot 5 dot bluemonster at xoxy dot net I continue to have problems with this, on FreeBSD 5.2.1 using ale's patched port for 4.3.6 and apache 2.0.49. apache seems to survive a graceful restart when I start it without SSL, but if I stop apache it leaves behind a bunch of httpd processes that I have to kill. If I start apache with SSL then it does not survive the graceful restart. ------------------------------------------------------------------------ [2004-04-21 07:46:57] sugihara at gix dot or dot jp OS : VineLinux2.6r4(kernel2.4.22) Apache: 2.0.49 PHP : 4.3.6 FreeBSD port works fine on Linux too. Without patch, 4.3.6 also caused Apache's segfault error. So Apache crashed everytime log files were rotated by cron. Thank you so much. ------------------------------------------------------------------------ [2004-04-20 16:49:04] paul at vanbrouwershaven dot com Same problem here with the lasted stable release PHP 4.3.6 ------------------------------------------------------------------------ [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.orig Fri 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, ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/27810 -- Edit this bug report at http://bugs.php.net/?id=27810&edit=1