[compiler-rt] 7d35226 - [msan] Change personality CHECK to Printf() + Die() (#160626)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 25 08:23:51 PDT 2025
Author: Thurston Dang
Date: 2025-09-25T08:23:47-07:00
New Revision: 7d35226173fad2f5d6a2b082583843ebcb8cea53
URL: https://github.com/llvm/llvm-project/commit/7d35226173fad2f5d6a2b082583843ebcb8cea53
DIFF: https://github.com/llvm/llvm-project/commit/7d35226173fad2f5d6a2b082583843ebcb8cea53.diff
LOG: [msan] Change personality CHECK to Printf() + Die() (#160626)
This ports https://github.com/llvm/llvm-project/pull/142821 from TSan.
Although MSan doesn't segfault the way TSan did, the failure message was
nonetheless cryptic. The improved error message will prepare MSan for
the upcoming AppArmorpocalypse.
Added:
Modified:
compiler-rt/lib/msan/msan_linux.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/msan/msan_linux.cpp b/compiler-rt/lib/msan/msan_linux.cpp
index 7140de7e9c543..f08a7c98a4847 100644
--- a/compiler-rt/lib/msan/msan_linux.cpp
+++ b/compiler-rt/lib/msan/msan_linux.cpp
@@ -190,7 +190,15 @@ bool InitShadowWithReExec(bool init_origins) {
"possibly due to high-entropy ASLR.\n"
"Re-execing with fixed virtual address space.\n"
"N.B. reducing ASLR entropy is preferable.\n");
- CHECK_NE(personality(old_personality | ADDR_NO_RANDOMIZE), -1);
+
+ if (personality(old_personality | ADDR_NO_RANDOMIZE) == -1) {
+ Printf(
+ "FATAL: MemorySanitizer: unable to disable ASLR (perhaps "
+ "sandboxing is enabled?).\n");
+ Printf("FATAL: Please rerun without sandboxing and/or ASLR.\n");
+ Die();
+ }
+
ReExec();
}
# endif
More information about the llvm-commits
mailing list