diff options
author | Kostya Serebryany <kcc@google.com> | 2013-10-17 11:18:11 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2013-10-17 11:18:11 +0000 |
commit | 8fa4edcb169ab77355c77e065fc5387085787a8a (patch) | |
tree | 1a506894ffecdc14fe7b1053e1b6ec28eac13a5e /lib/sanitizer_common/sanitizer_mutex.h | |
parent | fc81346321671489e2864f0614bf44b6af5d9bdb (diff) | |
download | compiler-rt-8fa4edcb169ab77355c77e065fc5387085787a8a.tar.gz compiler-rt-8fa4edcb169ab77355c77e065fc5387085787a8a.tar.bz2 compiler-rt-8fa4edcb169ab77355c77e065fc5387085787a8a.tar.xz |
[asan] Fix a deadlock between asan's allocator and lsan
Summary:
This fixes a deadlock which happens in lsan
on a large memalign-allocated chunk that resides in lsan's root set.
Reviewers: samsonov, earthdok
Reviewed By: earthdok
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1957
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192885 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_mutex.h')
-rw-r--r-- | lib/sanitizer_common/sanitizer_mutex.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_mutex.h b/lib/sanitizer_common/sanitizer_mutex.h index 469981c3..0f05f67f 100644 --- a/lib/sanitizer_common/sanitizer_mutex.h +++ b/lib/sanitizer_common/sanitizer_mutex.h @@ -40,6 +40,10 @@ class StaticSpinMutex { atomic_store(&state_, 0, memory_order_release); } + void AssertHeld() { + CHECK_EQ(atomic_load(&state_, memory_order_relaxed), 1); + } + private: atomic_uint8_t state_; |