PxPlus User Forum

Main Board => Discussions => Programming => Topic started by: dlocke on July 17, 2018, 10:48:13 AM

Title: Is it possible to get the program name and line number from a Linux core dump ?
Post by: dlocke on July 17, 2018, 10:48:13 AM
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 ?   

Title: Re: Is it possible to get the program name and line number from a Linux core dump ?
Post by: Mike King on July 17, 2018, 11:09:52 AM
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 (https://manual.pvxplus.com/page/PxPlus%20Installation%20and%20Configuration/Troubleshooting/Crash%20Analysis.htm) for further information.

Title: Re: Is it possible to get the program name and line number from a Linux core dump ?
Post by: dlocke on July 17, 2018, 12:20:29 PM
I will keep that in mind when updating to 2016.   

So there is no way to find that info in the core dump ? 
Title: Re: Is it possible to get the program name and line number from a Linux core dump ?
Post by: Mike King on July 17, 2018, 02:29:59 PM
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).