Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: segmentation fault

by jbert (Priest)
on Aug 27, 2008 at 13:04 UTC ( [id://707148]=note: print w/replies, xml ) Need Help??


in reply to segmentation fault

The suggestion elsewhere to use Devel::Trace is a good one.

Otherwise, you need to isolate what is causing the segmentation fault.

You might get some useful information by running perl under gdb and getting a backtrace:

box> gdb perl yourscript.pl gdb> r ...your program runs and then stops with a segmentation fault ...dropping you back to gdb... gdb> bt

the displayed backtrace is perl's call stack, it might give some information as to where perl is dying.

You might also have success by trying to find the minimum amount of code needed to cause the segfault. Try commenting out about 1/2 of the module loads (you can use =pod and =cut to comment out a block of code) and do a binary search. Even with a thousand modules, that would only take approx 10 steps.

Replies are listed 'Best First'.
Re^2: segmentation fault
by betterworld (Curate) on Aug 27, 2008 at 13:51 UTC
    box> gdb perl yourscript.pl gdb> r

    I think "yourscript.pl" shoud be after "r", not after "gdb perl".

      Thanks, you're right.

      I blame too much time spent in the perl debugger recently.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://707148]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2024-04-18 16:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found