SPUG: Segmentation Fault in mod_perl

Colin Meyer cmeyer at helvella.org
Tue Mar 13 12:52:11 CST 2001


On Mon, Mar 12, 2001 at 04:16:34PM -0800, Jonathan Gardner wrote:
> Okay, run while you still can! 


> What do I do to find out the problem, short of putting a "warn"
> between every line of code? How do I use the core dump - if it is
> useful at all? What rotting nuggets of useful knowledge are lodged in
> the wisdom teeth of the gurus, and could they use the toothbrush of
> the transfer of knowledge to reveal those morsels to me? :-)

Andrew's suggestion about compiling Apache without the expat library
solves many segfaults, which occur because of symbol conflicts between
differing versions of expat. Look out for other apache modules that may
use expat: PHP, mod_dav, AxKit, etc. If you need functionality from
more than one user of expat, you'll need to compile a separate httpd for
each one. Hopefully these many little incompatible expats will soon be
cleared up with centralized expat development at sourceforge.

If removing expat still doesn't fix your segfault crashing, there are
some more debugging options. Try running httpd with the -X switch to get
only one process, and use strace to see which system calls it completes
or hangs on. With a little practice, it is easy to compare strace logs
to your perl source and gain clues to the problem area(s). Another
option is to compile with c level debugging turned on and run with gdb.
I don't have much experience with the latter option, but I can point you
to the appropriate mod_perl guide sections to get started:

# the whole debugging section is well worth reading. Well, the whole
# guide is well worth reading

# using strace / truss

# using c level debugging:

Happy debugging,

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/

More information about the spug-list mailing list