summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2013-10-17 11:18:11 +0000
committerKostya Serebryany <kcc@google.com>2013-10-17 11:18:11 +0000
commitf04ae331067efa753cb8cde089c15e335219a2c3 (patch)
treee17adabd92f639f693ec585bb0ee1a2d09588d1d /compiler-rt/lib/sanitizer_common/sanitizer_allocator.h
parent95f7ba988bbc2713bbd13f7410751312e4aebbc9 (diff)
downloadbcm5719-llvm-f04ae331067efa753cb8cde089c15e335219a2c3.tar.gz
bcm5719-llvm-f04ae331067efa753cb8cde089c15e335219a2c3.zip
[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 llvm-svn: 192885
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_allocator.h')
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_allocator.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h b/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h
index 9fdc39ba365..0e99d298f7c 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h
@@ -1051,6 +1051,7 @@ class LargeMmapAllocator {
// This function does the same as GetBlockBegin, but is much faster.
// Must be called with the allocator locked.
void *GetBlockBeginFastLocked(void *ptr) {
+ mutex_.AssertHeld();
uptr p = reinterpret_cast<uptr>(ptr);
uptr n = n_chunks_;
if (!n) return 0;
OpenPOWER on IntegriCloud