another segv in sapi_apache2

From: Date: Sat, 18 Aug 2001 01:23:47 +0000
Subject: another segv in sapi_apache2
Groups: php.dev 
Request: Send a blank email to php-dev+get-63563@lists.php.net to get a copy of this message
doesn't seem right for this flush function to be called at server shutdown, ctx->f and ctx->f->r won't be alive at this point. so i'm not sure if this is the right fix, but patch below stops segv. with this and the cleanup_register patch bloom committed for me, all php tests in httpd-test are now passing under 2.0. also working fine through mod_ssl (t/TEST -ssl) #0 php_apache_sapi_flush (server_context=0x0) at sapi_apache2.c:175 175 bb = apr_brigade_create(ctx->f->r->pool); (gdb) where #0 php_apache_sapi_flush (server_context=0x0) at sapi_apache2.c:175 #1 0x40218eb6 in sapi_flush (tsrm_ls=0x8298040) at SAPI.c:559 #2 0x40214e07 in php_module_shutdown (tsrm_ls=0x8298040) at main.c:994 #3 0x40214dd1 in php_module_shutdown_wrapper (sapi_globals=0x402cf6a0) at main.c:973 #4 0x40212b11 in php_apache_server_shutdown (tmp=0x0) at sapi_apache2.c:397 #5 0x80e4d8c in run_cleanups (c=0x81e88b4) at apr_pools.c:771 #6 0x80e4ed4 in apr_pool_clear (a=0x81e887c) at apr_pools.c:874 #7 0x80e4f28 in apr_pool_destroy (a=0x81e887c) at apr_pools.c:920 #8 0x80ba9ce in clean_child_exit (code=0) at prefork.c:236 ... Index: sapi/apache2filter/sapi_apache2.c =================================================================== RCS file: /repository/php4/sapi/apache2filter/sapi_apache2.c,v retrieving revision 1.43 diff -u -r1.43 sapi_apache2.c --- sapi/apache2filter/sapi_apache2.c 17 Aug 2001 22:25:13 -0000 1.43 +++ sapi/apache2filter/sapi_apache2.c 18 Aug 2001 01:04:47 -0000 @@ -163,6 +163,10 @@ apr_bucket_brigade *bb; apr_bucket *b; + if (!server_context) { + return; + } + /* Send a flush bucket down the filter chain. The current default * handler seems to act on the first flush bucket, but ignores * all further flush buckets.

« previous php.dev (#63563) next »