php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16104 Apache2 segfault on startup in TSRM/TSRM.c:310
Submitted: 2002-03-15 15:23 UTC Modified: 2002-05-17 07:50 UTC
From: david+cert at blue-labs dot org Assigned:
Status: Closed Package: Apache2 related
PHP Version: 4.0CVS-2002-03-1 OS: Linux
Private report: No CVE-ID: None
 [2002-03-15 15:23 UTC] david+cert at blue-labs dot org
./configure \
 --with-apxs2=/usr/local/apache2/bin/apxs \
 --enable-debug

I have current HEAD code for both httpd-2.0 and php42.  If I try to start apache with the php module, it silently crashes on startup.  So I pop it into gdb and here's what I get.

(gdb) r -X
Starting program: /src/cvs/httpd-2.0/httpd -X
[New Thread 1024 (LWP 9253)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 9253)]
0x4031dad5 in ts_resource_ex (id=1, th_id=0x0) at /src/cvs/php4/TSRM/TSRM.c:310
310                             TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count);

(gdb) l
305                             TSRM_ERROR((TSRM_ERROR_LEVEL_INFO, "Fetching resource id %d for current thread %d", id, (long) thread_resources->thread_id));
306                             /* Read a specific resource from the thread's resources.
307                              * This is called outside of a mutex, so have to be aware about external
308                              * changes to the structure as we read it.
309                              */
310                             TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count);
311                     }
312                     thread_id = tsrm_thread_id();
313             } else {
314                     thread_id = *th_id; 

(gdb) bt
#0  0x4031dad5 in ts_resource_ex (id=1, th_id=0x0)
   at /src/cvs/php4/TSRM/TSRM.c:310
#1  0x40321bfd in php_module_startup (sf=0x4044eba0)
   at /src/cvs/php4/main/main.c:856
#2  0x403746f4 in php_apache_server_startup (pconf=0x81014c0, plog=0x81395a0,
   ptemp=0x818ad58, s=0x818dfd8)
   at /src/cvs/php4/sapi/apache2filter/sapi_apache2.c:428
#3  0x0808e43f in ap_run_post_config (pconf=0x81014c0, plog=0x81395a0, ptemp=0x818ad58, s=0x818dfd8) at config.c:127
#4  0x08092715 in main (argc=2, argv=0xbffff6e4) at main.c:603

(gdb) p *thread_resources
$2 = {storage = 0x50435245, count = 33, thread_id = 135231232, next = 0x20000010} 

Anybody have helpful suggestions here? This is fully repeatable.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-19 11:14 UTC] aaron@php.net
What version of Apache is this? Current CVS is known to
work with Apache 2.0.35 (GA) and the 4.2.0 branch of PHP
(in CVS). Please try again and report your success/failure
here.
 [2002-04-19 11:17 UTC] david+cert at blue-labs dot org
This was back on ~2.0.33.  I haven't had the heart to try it recently.
 [2002-04-21 18:44 UTC] jwoolley@php.net
This is the same bug as #16475.  I'm marking this one as
duplicate... further followup will happen under #16475.
Thanks!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 11:01:30 2024 UTC