[compiler-rt] a20794b - [Sanitizer] Call Die() instead of Abort() when failed to reserve shadow memory range (#107833)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 16 18:53:21 PDT 2024
Author: Enna1
Date: 2024-09-17T09:53:17+08:00
New Revision: a20794b574803677e6407bdccef136d2e1622535
URL: https://github.com/llvm/llvm-project/commit/a20794b574803677e6407bdccef136d2e1622535
DIFF: https://github.com/llvm/llvm-project/commit/a20794b574803677e6407bdccef136d2e1622535.diff
LOG: [Sanitizer] Call Die() instead of Abort() when failed to reserve shadow memory range (#107833)
I grep the code and find that `Abort()` is only called in `Die()` when
the flag `abort_on_error` is set.
Thus, if reserving shadow memory range fails, `Die()` rather than
`Abort()` should be called. In this case, the flag `abort_on_error` will
be respected and the die callbacks will be called.
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cpp
index 3966d82d51ee96..684720963a8dcb 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cpp
@@ -171,7 +171,7 @@ void ReserveShadowMemoryRange(uptr beg, uptr end, const char *name,
"ReserveShadowMemoryRange failed while trying to map 0x%zx bytes. "
"Perhaps you're using ulimit -v or ulimit -d\n",
size);
- Abort();
+ Die();
}
if (madvise_shadow && common_flags()->use_madv_dontdump)
DontDumpShadowMemory(beg, size);
More information about the llvm-commits
mailing list