diff options
| -rw-r--r-- | compiler-rt/lib/asan/asan_rtl.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler-rt/lib/asan/asan_rtl.cc b/compiler-rt/lib/asan/asan_rtl.cc index 661e55f0493..34b84f4d1be 100644 --- a/compiler-rt/lib/asan/asan_rtl.cc +++ b/compiler-rt/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 |

