Reputation: 400
I am trying to debug a deadlock/race condition in my multiprocess shared memory program. For some reason it is only deadlocking some of the time. I would like to know what each process is doing at this time so that I can find the bug. Any ideas on how I could use gdb or valgrind for this?
Upvotes: 1
Views: 1493
Reputation: 2840
Here's what I'd do:
Upvotes: 0
Reputation: 17455
Not a complete answer, just a thought:
you may attach to a working process using gdb -p <processId> /path/to/executable/being/debugged
. Or just use strace -p <pid>
.
BTW Right now I'm doing this for LibreOffice with KDE4 dialogs plugin hanging on startup (somewhere in libSM interaction) :) A typical race condition, because it works perfectly being run under gdb from start
Upvotes: 2