Main Board > Programming

Is it possible to get the program name and line number from a Linux core dump ?

(1/1)

dlocke:
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:
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.

dlocke:
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:
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: ---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$

--- End code ---

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). 



 

Navigation

[0] Message Index

Go to full version