Operating System - HP-UX
1835947 Members
2506 Online
110088 Solutions
New Discussion

Re: How to locate Perl program line that caused coredump?

 
Philip Chan_1
Respected Contributor

How to locate Perl program line that caused coredump?

Hi,

One of our Perl program went into coredump. Can someone please tell me the ways to determine which line from within the program caused that?

Thanks
Philip
6 REPLIES 6
Steven Sim Kok Leong
Honored Contributor

Re: How to locate Perl program line that caused coredump?

Hi,

Have you tried:
1) #!/usr/local/bin/perl -w
2) Inserting "print STDOUT" statements inside your perl program

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
Philip Chan_1
Respected Contributor

Re: How to locate Perl program line that caused coredump?

Hi Steve,

The Perl program runs on production environment therefore adding print statements isn't preferred. It may as well generate too much warnings if the -w flag is on. The most difficult part of this problem is that it seems intermittent, which only occurs once every few months. Diagnostic would be a lot easier if the program line that caused the coredump can be located.

Rgds,
Philip
Vincenzo Restuccia
Honored Contributor

Re: How to locate Perl program line that caused coredump?

#file core
#what core
#strings core|more
Greg Royle
Advisor

Re: How to locate Perl program line that caused coredump?

maybe you can use gdb (debugger) in conjunction with the perl interpreter to try and find out why and where it is aborting.
Eduardo Uribe_1
Occasional Advisor

Re: How to locate Perl program line that caused coredump?

Use gdb to locate it.
Eduardo Uribe_1
Occasional Advisor

Re: How to locate Perl program line that caused coredump?

Use gdb to locate it.
gdb program
(gdb) run [parameters]
It will run the program and will tell you when it's breaking.
(gdb) quit

Grato!