summaryrefslogtreecommitdiff
path: root/compiler-rt/lib/asan/asan_allocator.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-07-26 19:36:28 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-07-26 19:36:28 +0000
commitcfca06d7963fa0909f90483b42a6d7d194d01e08 (patch)
tree209fb2a2d68f8f277793fc8df46c753d31bc853b /compiler-rt/lib/asan/asan_allocator.cpp
parent706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff)
Notes
Diffstat (limited to 'compiler-rt/lib/asan/asan_allocator.cpp')
-rw-r--r--compiler-rt/lib/asan/asan_allocator.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler-rt/lib/asan/asan_allocator.cpp b/compiler-rt/lib/asan/asan_allocator.cpp
index 65c51fbafdd0..126d26d0823b 100644
--- a/compiler-rt/lib/asan/asan_allocator.cpp
+++ b/compiler-rt/lib/asan/asan_allocator.cpp
@@ -1037,8 +1037,19 @@ uptr PointsIntoChunk(void* p) {
return 0;
}
+// Debug code. Delete once issue #1193 is chased down.
+extern "C" SANITIZER_WEAK_ATTRIBUTE const char *__lsan_current_stage;
+
uptr GetUserBegin(uptr chunk) {
__asan::AsanChunk *m = __asan::instance.GetAsanChunkByAddrFastLocked(chunk);
+ if (!m)
+ Printf(
+ "ASAN is about to crash with a CHECK failure.\n"
+ "The ASAN developers are trying to chase down this bug,\n"
+ "so if you've encountered this bug please let us know.\n"
+ "See also: https://github.com/google/sanitizers/issues/1193\n"
+ "chunk: %p caller %p __lsan_current_stage %s\n",
+ chunk, GET_CALLER_PC(), __lsan_current_stage);
CHECK(m);
return m->Beg();
}