summaryrefslogtreecommitdiff
path: root/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
commit8fa4edcb169ab77355c77e065fc5387085787a8a (patch)
tree1a506894ffecdc14fe7b1053e1b6ec28eac13a5e /lib/sanitizer_common/sanitizer_allocator.h
parentfc81346321671489e2864f0614bf44b6af5d9bdb (diff)
downloadcompiler-rt-8fa4edcb169ab77355c77e065fc5387085787a8a.tar.gz
[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_allocator.h')
-rw-r--r--lib/sanitizer_common/sanitizer_allocator.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_allocator.h b/lib/sanitizer_common/sanitizer_allocator.h
index 9fdc39ba3..0e99d298f 100644
--- a/lib/sanitizer_common/sanitizer_allocator.h
+++ b/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;