[llvm-dev] [ThreadSanitizer] Get deadlocks working

Vaivaswatha Nagaraj via llvm-dev llvm-dev at lists.llvm.org
Mon Sep 7 09:48:13 PDT 2015


Hi,

I am interested in understand the compiler-rt thread sanitizer tool and
have recently started experimenting with it. In particular, I'm interested
in the deadlock detector.

I see that deadlock detection currently don't work. (I tried with a few
simple deadlocks, as well as the test case "must_deadlock.cc" that is in
the test-suite). I understand from the comments that this is because the
real pthread_mutex_lock() is called before the handler (MutexLock()) in
tsan.

1. Is there any particular reason that this interceptor is designed this
way? Can there be a callback prior to calling the real pthread_mutex_lock()
that can, for example, detect deadlocks?
2. Upon debugging a simple test case, I see that there is a worker thread
that is created. Can this worker not check for the deadlock when the actual
threads are deadlocked.

Thanks,

  - Vaivaswatha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150907/0d187625/attachment.html>


More information about the llvm-dev mailing list