in reply to Re: Investigating segmentation core file in perl
in thread Investigating segmentation core file in perl

I checked for some tutorials and they say , i have to provide a executable as the first parameter and core file as the second parameter to gdb as gdb <executable> <core file> What would be this executable in case of perl scripts
  • Comment on Re^2: Investigating segmentation core file in perl

Replies are listed 'Best First'.
Re^3: Investigating segmentation core file in perl
by cdarke (Prior) on Jul 31, 2009 at 12:37 UTC
    The executeable is perl, you might have to supply the full path name, for example: /usr/bin/perl. Make sure it is exactly the same executable as caused the dump. If you are new to core dumps and gdb, one of the most useful short commands is bt, or "backtrace". This should give the routine it crashed in and the call stack. However you will only get that if perl have been compiled in debug (-g option to cc/gcc). Alos, if the call stack has been overwritten by the bug then you can't go much further.

    Perl *shouldn't* crash, if it does then you have uncovered a bug which should be reported. Unless, that is, you are using some hokey module written in XS, have embedded C, or the like.
Re^3: Investigating segmentation core file in perl
by Utilitarian (Vicar) on Jul 31, 2009 at 13:49 UTC
    Run the following, adjusting for local conditions
    gdb -e /usr/bin/perl -c /var/cores/localhost.perl.core.1610952111
    Then inside the gdb shell try the following to see what was going on
    bt # gives a frame stack bt full # framestack with value of variables