[LAD] Finding Deadlock causes in multithreaded C++ using gdb

Arnold Krille arnold at arnoldarts.de
Sun Feb 20 21:56:42 UTC 2011


On Sunday 20 February 2011 22:49:47 Paul Davis wrote:
> On Sun, Feb 20, 2011 at 4:12 PM, Harry Van Haaren <harryhaaren at gmail.com> 
wrote:
> > Hey guys,
> > 
> > I'm working on a mulithreaded version of my pet project, and I've now
> > managed to deadlock one thread,
> > which in turn makes the GUI thread wait for a mutex lock, and then
> > finally segfaults the whole program :-)
> > 
> > So I'm looking for pointers on how best to find a deadlock's cause using
> > gdb?
> 
> gdb) thread apply all bt
> 
> this will show you the state of all threads so you can spot the two of
> them that are waiting for the same or the same pair of locks.

Hmph, I use that command actually almost every day. Yet I didn't think about 
this a minute ago... Seems this command is actually to usefull to me to spend 
thinking on it. Doing it is enough to solve problems...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20110220/86f2fb90/attachment.pgp>


More information about the Linux-audio-dev mailing list