summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2012-09-07 15:34:40 +0000
committerAlexander Potapenko <glider@google.com>2012-09-07 15:34:40 +0000
commit5aabcb547a983653a754258d63e27e3790c564d3 (patch)
tree8928a552943744896121bb08a9215ca6fe734681 /lib
parent7315c26122cbdfee82f4dbadaedd5c1b85755503 (diff)
Two minor changes:
-- exit from infinite recursion in CHECK() -- print a verbose message if mapping of the shadow memory has failed. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163391 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/asan/asan_rtl.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/asan/asan_rtl.cc b/lib/asan/asan_rtl.cc
index 661e55f04..34b84f4d1 100644
--- a/lib/asan/asan_rtl.cc
+++ b/lib/asan/asan_rtl.cc
@@ -53,6 +53,9 @@ SANITIZER_INTERFACE_ATTRIBUTE
void CheckFailed(const char *file, int line, const char *cond, u64 v1, u64 v2) {
Report("AddressSanitizer CHECK failed: %s:%d \"%s\" (0x%zx, 0x%zx)\n",
file, line, cond, (uptr)v1, (uptr)v2);
+ static __thread int recursion_count = 0;
+ RAW_CHECK_MSG(recursion_count == 0, "Infinite recursion detected in CHECK\n");
+ recursion_count++;
PRINT_CURRENT_STACK();
ShowStatsAndAbort();
}
@@ -171,7 +174,11 @@ static void ReserveShadowMemoryRange(uptr beg, uptr end) {
CHECK(((end + 1) % kPageSize) == 0);
uptr size = end - beg + 1;
void *res = MmapFixedNoReserve(beg, size);
- CHECK(res == (void*)beg && "ReserveShadowMemoryRange failed");
+ if (res != (void*)beg) {
+ Report("ReserveShadowMemoryRange failed while trying to map 0x%zx bytes. "
+ "Perhaps you're using ulimit -v\n", size);
+ Abort();
+ }
}
// --------------- LowLevelAllocateCallbac ---------- {{{1