Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: segmentation fault

by jbert (Priest)
on Aug 27, 2008 at 13:04 UTC ( #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.


Comment on Re: segmentation fault
Select or Download Code
Re^2: segmentation fault
by betterworld (Deacon) 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
Node Status?
node history
Node Type: note [id://707148]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (14)
As of 2014-10-24 16:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (133 votes), past polls