From: Ryan Bloom Date: Fri, 17 Aug 2001 22:25:13 +0000 (+0000) Subject: Fix a seg fault in PHP. If a child process is created in the server, X-Git-Tag: PRE_SUBST_Z_MACROS~466 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1543904d71ed791999147599c6e244df646a9ff4;p=php Fix a seg fault in PHP. If a child process is created in the server, using apr_proc_create, it will seg fault, because PHP is using a NULL child cleanup. To fix this, we have to use the special cleanup function, apr_pool_cleanup_null. This also fixes a compiler warning in the ap_log_error call. --- diff --git a/sapi/apache2filter/apache_config.c b/sapi/apache2filter/apache_config.c index 2b0ce50c7e..a70f926996 100644 --- a/sapi/apache2filter/apache_config.c +++ b/sapi/apache2filter/apache_config.c @@ -150,7 +150,7 @@ void *create_php_config(apr_pool_t *p, char *dummy) phpapdebug((stderr, "Creating new config (%p) for %s\n", newx, dummy)); zend_hash_init(&newx->config, 0, NULL, NULL, 1); - apr_pool_cleanup_register(p, newx, destroy_php_config, NULL); + apr_pool_cleanup_register(p, newx, destroy_php_config, apr_pool_cleanup_null); return (void *) newx; } diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c index 5a57ab1122..d50c078417 100644 --- a/sapi/apache2filter/sapi_apache2.c +++ b/sapi/apache2filter/sapi_apache2.c @@ -188,7 +188,7 @@ static void php_apache_sapi_log_message(char *msg) * line. Not sure if this is correct, but it mirrors what happens * with Apache 1.3 -- rbb */ - ap_log_error(NULL, APLOG_ERR | APLOG_NOERRNO | APLOG_STARTUP, 0, ctx->f->r->server, "%s", msg); + ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO | APLOG_STARTUP, 0, ctx->f->r->server, "%s", msg); } static sapi_module_struct apache2_sapi_module = { @@ -402,7 +402,7 @@ php_apache_server_startup(apr_pool_t *pchild, server_rec *s) tsrm_startup(1, 1, 0, NULL); sapi_startup(&apache2_sapi_module); apache2_sapi_module.startup(&apache2_sapi_module); - apr_pool_cleanup_register(pchild, NULL, php_apache_server_shutdown, NULL); + apr_pool_cleanup_register(pchild, NULL, php_apache_server_shutdown, apr_pool_cleanup_null); php_apache_register_module(); }