aboutsummaryrefslogtreecommitdiff
path: root/lib/libtsan/tsan_platform_linux.cpp
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2025-07-16 11:22:46 +0200
committerAlex Rønne Petersen <alex@alexrp.com>2025-08-30 06:36:41 +0200
commitac2050609055d76a58b058b064f0b0c4d54e2faa (patch)
tree54855b2bde3e1eed89d870251b044e93972f6c5c /lib/libtsan/tsan_platform_linux.cpp
parent85438e75e04b356ca319051c33e0987a9958ad4a (diff)
downloadzig-ac2050609055d76a58b058b064f0b0c4d54e2faa.tar.gz
zig-ac2050609055d76a58b058b064f0b0c4d54e2faa.zip
libtsan: update to LLVM 21
Diffstat (limited to 'lib/libtsan/tsan_platform_linux.cpp')
-rw-r--r--lib/libtsan/tsan_platform_linux.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/lib/libtsan/tsan_platform_linux.cpp b/lib/libtsan/tsan_platform_linux.cpp
index 3e08a1bece..2c55645a15 100644
--- a/lib/libtsan/tsan_platform_linux.cpp
+++ b/lib/libtsan/tsan_platform_linux.cpp
@@ -259,7 +259,15 @@ static void ReExecIfNeeded(bool ignore_heap) {
"WARNING: Program is run with randomized virtual address "
"space, which wouldn't work with ThreadSanitizer on Android.\n"
"Re-execing with fixed virtual address space.\n");
- CHECK_NE(personality(old_personality | ADDR_NO_RANDOMIZE), -1);
+
+ if (personality(old_personality | ADDR_NO_RANDOMIZE) == -1) {
+ Printf(
+ "FATAL: ThreadSanitizer: unable to disable ASLR (perhaps "
+ "sandboxing is enabled?).\n");
+ Printf("FATAL: Please rerun without sandboxing and/or ASLR.\n");
+ Die();
+ }
+
reexec = true;
}
# endif
@@ -287,7 +295,18 @@ static void ReExecIfNeeded(bool ignore_heap) {
"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: ThreadSanitizer: encountered an incompatible memory "
+ "layout but was unable to disable ASLR (perhaps sandboxing is "
+ "enabled?).\n");
+ Printf(
+ "FATAL: Please rerun with lower ASLR entropy, ASLR disabled, "
+ "and/or sandboxing disabled.\n");
+ Die();
+ }
+
reexec = true;
} else {
Printf(
@@ -373,6 +392,12 @@ void InitializePlatformEarly() {
Printf("FATAL: Found %zd - Supported 39 and 48\n", vmaSize);
Die();
}
+# else
+ if (vmaSize != 48) {
+ Printf("FATAL: ThreadSanitizer: unsupported VMA range\n");
+ Printf("FATAL: Found %zd - Supported 48\n", vmaSize);
+ Die();
+ }
# endif
# endif