PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Is it possible to get the program name and line number from a Linux core dump ?  (Read 1892 times)

dlocke

  • Member
  • **
  • Posts: 17
    • View Profile
I had a segfault today during an update. 
Is there a way to find the program name and line number from the core dump using the gdb command ?   


Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Assuming you are running a PxPlus 2016 or newer, you should be able to define a LOGFILE in your INI and the system will place dump information into that file.

The system will produce a dump whenever the OS detects a fault (such as segfault) and it will contain the program running, call stack, and a list of open files.

Check out this link for further information.

Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

dlocke

  • Member
  • **
  • Posts: 17
    • View Profile
I will keep that in mind when updating to 2016.   

So there is no way to find that info in the core dump ? 

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
I'm sure the information is in the core dump somewhere, but there is no easy way to locate the values.

If the issue is reproducible, then you should be able to setup the log file and replicate the failure.  If its a one time failure then it could be anything and potentially not even anything related to your application.

I would setup a log file then watch for the problem to resurface.

One simple technique for the log file is add logic like:

Code: [Select]
DayNo = JUL(0,0,0)
P$ = "/tmp/pxpluslog."+dte(DayNo +1:"%Ws")
ERASE P$,ERR=*NEXT
P$ = "/tmp/pxpluslog."+dte(DayNo :"%Ws")
SERIAL P$,ERR=*NEXT
SETDEV (0) SET "LogFile" TO P$

This will create you a daily log file with the day of the week in its name and keep the last 6 (requires the logic to run at least once per day every day). 



 
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com