From ac2050609055d76a58b058b064f0b0c4d54e2faa Mon Sep 17 00:00:00 2001 From: Alex Rønne Petersen Date: Wed, 16 Jul 2025 11:22:46 +0200 Subject: libtsan: update to LLVM 21 --- lib/libtsan/tsan_platform_linux.cpp | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'lib/libtsan/tsan_platform_linux.cpp') 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 -- cgit v1.2.3