Commit Graph

29 Commits

Author SHA1 Message Date
Dmitry Vyukov 84fa6b37f4 tsan: fix deadlock reporting
currently deadlock detector reports effectively random stacks in report after flush
because it looks at old edges with wrong stacks

llvm-svn: 224519
2014-12-18 14:05:34 +00:00
Dmitry Vyukov a8def72dd6 tsan: fix failing CHECK In deadlock detector
and re-enable the test

llvm-svn: 224518
2014-12-18 14:02:28 +00:00
Hans Wennborg ec77f619bb sanitizer_deadlock_detector.h: MSVC 2012 doesn't like compound literals
llvm-svn: 206199
2014-04-14 17:43:45 +00:00
Kostya Serebryany 683d55f50e [sanitizer] speed up the bitvector-based deadlock detector by ~15% (iterate over the currently held locks using the array, not the bitvector. Bitvector is not the best data structure to iterate over)
llvm-svn: 205168
2014-03-31 07:23:50 +00:00
Kostya Serebryany 3df5d87da4 [sanitizer] print threads in deadlock report
llvm-svn: 204461
2014-03-21 13:00:18 +00:00
Kostya Serebryany 78f2e7bd62 [sanitizer] use some c++11 to simplify the code (we can now). Fix one place where a mutex acquisition stack trace was not properly remembered
llvm-svn: 204237
2014-03-19 14:19:31 +00:00
Kostya Serebryany 2483acce21 [sanitizer] when recycling deadlock graph nodes, properly recycle edges
llvm-svn: 204233
2014-03-19 13:53:37 +00:00
Kostya Serebryany f01c094cdd [sanitizer] reverse the order of the stack traces printed for every pair of locks in the deadlock report (first print the 'from' node, then print the 'to' node of the deadlock graph)
llvm-svn: 204043
2014-03-17 14:56:04 +00:00
Kostya Serebryany 8976539627 [sanitizer] make the deadlock detector print 2*N stack traces on lock-order-inversion with N locks (i.e. print stack traces for both lock acquisitions in every edge in the graph). More improvements to follow
llvm-svn: 204042
2014-03-17 14:41:36 +00:00
Kostya Serebryany a0eb97a50b [sanitizer] allow to store the lock context (stack trace id) with all currently held locks in a thread. This will allow the deadlock detector to provide better warnings (more changes to go)
llvm-svn: 204039
2014-03-17 12:27:42 +00:00
Kostya Serebryany 8ecd7a2171 [sanitizer] fully implement racy fast path in bitset-based deadlock detector
llvm-svn: 203910
2014-03-14 09:22:01 +00:00
Kostya Serebryany 61a0f1c564 [sanitizer] partially implement racy fast path in bitset-based deadlock detector
llvm-svn: 203904
2014-03-14 08:06:15 +00:00
Kostya Serebryany c067864b6f [sanitizer] in bitset-based deadlock detector collect edge's stack trace when an edge is added to the graph (in following CLs these stack traces will be added to the report)
llvm-svn: 203902
2014-03-14 07:09:01 +00:00
Kostya Serebryany 65dbf46950 [sanitizer] in bitvector-based deadlock detector split onLock into onLockBefore and onLockAfter hooks
llvm-svn: 203796
2014-03-13 13:21:30 +00:00
Kostya Serebryany de3f20cf4b [sanitizer] support recursive rwlocks in bitset-based deadlock detector
llvm-svn: 203779
2014-03-13 10:26:03 +00:00
Kostya Serebryany eae464f911 [sanitizer] speedup deadlock detector for the case when we acquire the first lock in a thread
llvm-svn: 202492
2014-02-28 11:56:14 +00:00
Kostya Serebryany 2ff42d98fa [sanitizer] do not acquire a global mutex in deadlock detector when dealing with Unlock (it is essentially a thread-local operation)
llvm-svn: 202401
2014-02-27 14:38:42 +00:00
Kostya Serebryany 11f4f30fa7 [sanitizer] add support for try_lock in deadlock detector
llvm-svn: 202120
2014-02-25 08:24:15 +00:00
Kostya Serebryany 6d54611fd4 [sanitizer] fix epoch handling in deadlock detector (before the fix, we could have had edges from locks in the previous epoch to locks in the current epoch)
llvm-svn: 202118
2014-02-25 07:34:41 +00:00
Kostya Serebryany 37ce26cb16 [sanitizer] when reporting a deadlock also report the lock cycle
llvm-svn: 201576
2014-02-18 14:56:19 +00:00
Kostya Serebryany bd86a29a2a [sanitizer] make sure the deadlock detector survives the change of epochs; add a test and a comment
llvm-svn: 201572
2014-02-18 13:41:49 +00:00
Kostya Serebryany 6774f2241d [sanitizer] add tests for DeadlockDetector, minor fix in onLock
llvm-svn: 201514
2014-02-17 14:57:49 +00:00
Kostya Serebryany 73325589dc [sanitizer] implement node removal in Deadlock graph
llvm-svn: 201509
2014-02-17 11:21:52 +00:00
Kostya Serebryany ec68429c5d [sanitizer] simplify DeadlockDetectorTLS
llvm-svn: 201505
2014-02-17 08:47:48 +00:00
Kostya Serebryany e233d8618d [sanitizer] add iterators to bit vectors; make bit vector operations use little stack; add common flag 'detect_deadlocks'
llvm-svn: 201405
2014-02-14 12:08:23 +00:00
Kostya Serebryany 67d419736a [sanitizer] optimize TwoLevelBitVector::intersectsWith, extend tests, fix a check
llvm-svn: 201338
2014-02-13 15:45:20 +00:00
Kostya Serebryany 07526fb4a0 [sanitizer] address some of the dvyukov's comments on previous commits
llvm-svn: 201322
2014-02-13 12:39:21 +00:00
Kostya Serebryany f6cb35abb4 [sanitizer] findPath for deadlock detector
llvm-svn: 201306
2014-02-13 09:52:15 +00:00
Kostya Serebryany 5e52d48e3a [sanitizer] more code for deadlock detector, nothing really works yet (except for small unit tests).
llvm-svn: 201302
2014-02-13 07:44:51 +00:00