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

From: Paul Davis <paul@email-addr-hidden>
Date: Sun Feb 20 2011 - 23:49:47 EET

On Sun, Feb 20, 2011 at 4:12 PM, Harry Van Haaren <harryhaaren@email-addr-hidden> 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.

valgrind also has some good lock-debugging options.
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Mon Feb 21 00:15:03 2011

This archive was generated by hypermail 2.1.8 : Mon Feb 21 2011 - 00:15:03 EET