cvs: php4 /sapi/apache2filter apache_config.c sapi_apache2.c
| From: | Ryan Bloom | Date: | Fri, 17 Aug 2001 22:25:13 +0000 |
| Subject: | cvs: php4 /sapi/apache2filter apache_config.c sapi_apache2.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-6925@lists.php.net to get a copy of this message | ||
rbb Fri Aug 17 18:25:13 2001 EDT
Modified files:
/php4/sapi/apache2filter apache_config.c sapi_apache2.c
Log:
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.
Index: php4/sapi/apache2filter/apache_config.c
diff -u php4/sapi/apache2filter/apache_config.c:1.11 php4/sapi/apache2filter/apache_config.c:1.12
--- php4/sapi/apache2filter/apache_config.c:1.11 Wed Feb 28 09:11:34 2001
+++ php4/sapi/apache2filter/apache_config.c Fri Aug 17 18:25:13 2001
@@ -150,7 +150,7 @@
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;
}
Index: php4/sapi/apache2filter/sapi_apache2.c
diff -u php4/sapi/apache2filter/sapi_apache2.c:1.42 php4/sapi/apache2filter/sapi_apache2.c:1.43
--- php4/sapi/apache2filter/sapi_apache2.c:1.42 Thu Aug 16 02:09:12 2001
+++ php4/sapi/apache2filter/sapi_apache2.c Fri Aug 17 18:25:13 2001
@@ -188,7 +188,7 @@
* 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 @@
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();
}