[llvm-commits] [compiler-rt] r163391 - /compiler-rt/trunk/lib/asan/asan_rtl.cc
Alexander Potapenko
glider at google.com
Fri Sep 7 08:34:40 PDT 2012
Author: glider
Date: Fri Sep 7 10:34:40 2012
New Revision: 163391
URL: http://llvm.org/viewvc/llvm-project?rev=163391&view=rev
Log:
Two minor changes:
-- exit from infinite recursion in CHECK()
-- print a verbose message if mapping of the shadow memory has failed.
Modified:
compiler-rt/trunk/lib/asan/asan_rtl.cc
Modified: compiler-rt/trunk/lib/asan/asan_rtl.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_rtl.cc?rev=163391&r1=163390&r2=163391&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_rtl.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_rtl.cc Fri Sep 7 10:34:40 2012
@@ -53,6 +53,9 @@
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 @@
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
More information about the llvm-commits
mailing list