Index: lib/asan/asan_rtl.cc =================================================================== --- lib/asan/asan_rtl.cc +++ lib/asan/asan_rtl.cc @@ -377,6 +377,8 @@ // initialization steps look at flags(). InitializeFlags(); + CheckVMASize(); + AsanCheckIncompatibleRT(); AsanCheckDynamicRTPrereqs(); @@ -585,7 +587,6 @@ // Initialize as requested from instrumented application code. // We use this call as a trigger to wake up ASan from deactivated state. void __asan_init() { - CheckVMASize(); AsanActivate(); AsanInitInternal(); } Index: lib/dfsan/dfsan.cc =================================================================== --- lib/dfsan/dfsan.cc +++ lib/dfsan/dfsan.cc @@ -399,6 +399,8 @@ } static void dfsan_init(int argc, char **argv, char **envp) { + InitializeFlags(); + CheckVMASize(); MmapFixedNoReserve(kShadowAddr, kUnusedAddr - kShadowAddr); @@ -412,7 +414,6 @@ if (!(init_addr >= kUnusedAddr && init_addr < kAppAddr)) MmapNoAccess(kUnusedAddr, kAppAddr - kUnusedAddr); - InitializeFlags(); InitializeInterceptors(); // Register the fini callback to run when the program terminates successfully Index: lib/msan/msan.cc =================================================================== --- lib/msan/msan.cc +++ lib/msan/msan.cc @@ -375,12 +375,13 @@ msan_init_is_running = 1; SanitizerToolName = "MemorySanitizer"; - CheckVMASize(); - InitTlsSize(); CacheBinaryName(); InitializeFlags(); + + CheckVMASize(); + __sanitizer_set_report_path(common_flags()->log_path); InitializeInterceptors(); Index: lib/tsan/rtl/tsan_rtl.cc =================================================================== --- lib/tsan/rtl/tsan_rtl.cc +++ lib/tsan/rtl/tsan_rtl.cc @@ -312,9 +312,6 @@ if (is_initialized) return; is_initialized = true; - - CheckVMASize(); - // We are not ready to handle interceptors yet. ScopedIgnoreInterceptors ignore; SanitizerToolName = "ThreadSanitizer"; @@ -325,6 +322,7 @@ const char *options = GetEnv(kTsanOptionsEnv); CacheBinaryName(); InitializeFlags(&ctx->flags, options); + CheckVMASize(); #ifndef SANITIZER_GO InitializeAllocator(); #endif