Skip to content
Prev 312516 / 398506 Next

segfault debugging

On 30/11/2012 12:02 PM, Donatella Quagli wrote:
This isn't easy, but what I would do is add something to your script to 
get it to pause (or to wait for some file to be created, or some other 
signal), then figure out the process number, and tell gdb to connect to 
it after it has already started.

The ps command will list all the running processes, for some definition 
of "all".  Then

gdb --pid=PID

will connect to the process with id PID.  I believe it will interrupt 
the process at that point, but you can restart it, send the signal to it 
to get out of its loop), and hopefully see the segfault in action.

Duncan Murdoch