[H-GEN] Apache segfaulting... how to debug

Michael Anthon michael at anthon.net
Wed Jul 9 23:28:03 EDT 2003


[ Humbug *General* list - semi-serious discussions about Humbug and     ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]

> The critical lines are the last few:
> 
> 12978 munmap(0x42a09000, 21132)         = 0
> 12978 munmap(0x42951000, 471868)        = 0
> 12978 close(21)                         = 0
> 12978 --- SIGSEGV (Segmentation fault) ---
> 7300  wait4(-1, [WIFSIGNALED(s) && WTERMSIG(s) == SIGSEGV], WNOHANG, 
> NULL) = 12978
> 
> vs.
> 
> 12977 munmap(0x42a09000, 21132)         = 0
> 12977 munmap(0x42951000, 471868)        = 0
> 12977 close(21)                         = 0
> 12977 munmap(0x40012000, 4096)          = 0
> 12977 semget(IPC_PRIVATE, 4096, IPC_CREAT|IPC_NOWAIT|0x80f20a0|0240) = 
> -1 ENOSYS (Function not implemented)
> 12977 _exit(0)                          = ?
> 7300  <... wait4 resumed> [WIFEXITED(s) && WEXITSTATUS(s) == 0], 
> WNOHANG, NULL) = 12977
> 
> Note the third munmap.  I would also look for somesort of allocation 
> returning address 0x40012000 to see which memory is being cleaned up at 
> the time (note: This would the memory being corrupted, NOT necessarally 
> associated with the corrupting code).

Umm... HUH?  Just so that everyone knows, I'm not a C programmer.  I 
know enough to get me into all sorts of diabolicals and just enough to 
get me out of most of them 8^)  I have just rebuilt apache and php from 
scratch (using deb source) and they are both now linked against 
libpthread but it's still segfaulting.  The critical thing seems to be 
that a thread that has accessed the OCI8 library to talk to the oracle 
DB seems to cause this.  I haven't got any hard evidence to back up this 
claim though.  It seems that if I continuously access a page that 
accesses only mysql then I never see the fault, if I then access the 
oracle database once, then some time down the track an apache thread 
will segfault.  I have a wget process that hammers a mysql page for 
10,000 hits, then access the oracle page from my web browser.  Seems to 
be fairly consistent although it's hard to be sure because others are 
also using the system.

I'm starting to think that this is perhaps a fault in the Oracle libs 
that the php4 oci8 module is linked against.

bash> ldd /usr/lib/php4/20020429/oci8.so
         libclntsh.so.8.0 => /oracle/as9i/lib/libclntsh.so.8.0 (0x40010000)
         libc.so.6 => /lib/libc.so.6 (0x405d6000)
         libwtc8.so => /oracle/as9i/lib/libwtc8.so (0x406e6000)
         libdl.so.2 => /lib/libdl.so.2 (0x406ee000)
         libm.so.6 => /lib/libm.so.6 (0x406f1000)
         libpthread.so.0 => /lib/libpthread.so.0 (0x40712000)
         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

If I understand the gist of what Andrae is saying then you are 
suggesting that something is allocating some memory but not cleaning up 
after itself?

Cheers,
Michael


--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.  See http://www.humbug.org.au/



More information about the General mailing list