On Mon, 2012-03-26 at 19:48 +0530, Manish Jain wrote:
> Can somebody please tell me what might be the problem ?

Helgrind detects lock order violations after a lock has been taken.
Depending on the thread scheduling, your test program will deadlock
before the threads have locked the 2nd lock.

To verify this, examine the thread status using the Valgrind gdbserver.

Note that with 3.8.0 SVN, using --fair-sched=yes, the error
was (sometimes?) detected.

Note that the code of helgrind is somewhat confusing,
as the thread lock order is verified by the function 
laog__pre_thread_acquires_lock (so it looks like this is done
before the thread acquires the lock) but in fact this function is
called inside evhH__post_thread_w_acquires_lock, which is called
after the lock has been acquired.

Philippe



------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to