Skip to content

Commit 7d35226

Browse files
authored
[msan] Change personality CHECK to Printf() + Die() (#160626)
This ports #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.
1 parent 25c0da8 commit 7d35226

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

compiler-rt/lib/msan/msan_linux.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,15 @@ bool InitShadowWithReExec(bool init_origins) {
190190
"possibly due to high-entropy ASLR.\n"
191191
"Re-execing with fixed virtual address space.\n"
192192
"N.B. reducing ASLR entropy is preferable.\n");
193-
CHECK_NE(personality(old_personality | ADDR_NO_RANDOMIZE), -1);
193+
194+
if (personality(old_personality | ADDR_NO_RANDOMIZE) == -1) {
195+
Printf(
196+
"FATAL: MemorySanitizer: unable to disable ASLR (perhaps "
197+
"sandboxing is enabled?).\n");
198+
Printf("FATAL: Please rerun without sandboxing and/or ASLR.\n");
199+
Die();
200+
}
201+
194202
ReExec();
195203
}
196204
# endif

0 commit comments

Comments
 (0)