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.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,


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.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,

------------------------------------------------------------------------

[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.1&content-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 "0x00000010". 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)

If Apache2 is not started with "-D SSL" and PHP 4.3.6 is used (over
4.3.5), the app error does not happen.

------------------------------------------------------------------------

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

Reply via email to