The testcase http://www.davidfaure.fr/2012/qmutex_trylock.cpp
(from https://bugs.kde.org/show_bug.cgi?id=243232)
shows that an optimization inside Qt leads to a helgrind warning about wrong 
lock ordering, making the use of that feature impossible for detecting actual 
problems elsewhere (i.e. I have to use --track-lockorders=no all the time).

Technically if we ignore the distinction between lock and tryLock, helgrind is 
right, we did lock the mutexes in reverse order. But because it's a tryLock, 
it couldn't possibly deadlock.

Should helgrind simply ignore all pthread_mutex_trylock calls, for the 
lockorder detection, even if they succeed? I think so, actually (by definition 
they couldn't deadlock, which is what track-lockorders is all about).

But if you think it should only be ignored in this particular case, are there 
magic macros in helgrind.h that could be used to annotate this tryLock() call?


PS: see my previous email about VALGRIND_HG_ENABLE_CHECKING not working. Is 
this known? Should I report a bug?

-- 
David Faure, [email protected], http://www.davidfaure.fr
Working on KDE, in particular KDE Frameworks 5


------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to