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

Greg Black gjb at gbch.net
Wed Jul 9 23:56:07 EDT 2003


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

On 2003-07-10, Michael Anthon wrote:

> Umm... HUH?  Just so that everyone knows, I'm not a C programmer.

OK, it was probably good to tell us that as it will help us to
avoid saying stuff that won't help.

> 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 next thing I would do is build it all again without threads
and see if the problem goes away.  If this fixes it, I'd then
see what the performance was like in that form.  If it doesn't
suck too much, I'd leave it like that and pronounce myself quite
satisfied.  I don't think threads are the solution to anything
in the context of this sort of software[1].

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

That might be so, and it would be something to explore if the
suggestions I made above don't bear useful fruit.

> 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?

Not really -- it's a case of something writing on memory that it
doesn't own.  Tracking down this class of (all-too-common) bugs
in C code is non-trivial, even for C gods.  It's not worth going
into more detail now, especially for an audience that's not very
comfortable with C.

Cheers, Greg

[1] Here are some quotes that I trot out when people want to
    promote threads.  They're stolen from various mailing lists
    that I read and seem to be on the money from where I stand:

    * Multithreading is a marketing gag from Sun and Microsoft,
      because it's cheaper to tell people to use multithreading
      than get the OS primitives for singlethreading to perform
      well.

    * Programs using multithreading "for good performance" are
      almost always broken by design and should be discarded
      immediately.

    * Perhaps Alan Cox said it best: "Computers are state
      machines.  Threads are for people who can't program state
      machines."

-- 
Greg Black <gjb at gbch.net> <http://www.gbch.net/gjb.html>
GPG signed mail preferred; further information in headers.

--
* 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