[LSAN][HWASAN] Turn on leak sanitizer in HWASAN for Linux
authorKirill Stoimenov <kstoimenov@google.com>
Thu, 16 Mar 2023 05:45:03 +0000 (05:45 +0000)
committerKirill Stoimenov <kstoimenov@google.com>
Thu, 16 Mar 2023 05:48:25 +0000 (05:48 +0000)
Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D146098

compiler-rt/lib/hwasan/hwasan.cpp

index 662cfb4..0a5999c 100644 (file)
@@ -86,8 +86,9 @@ static void InitializeFlags() {
     cf.clear_shadow_mmap_threshold = 4096 * (SANITIZER_ANDROID ? 2 : 8);
     // Sigtrap is used in error reporting.
     cf.handle_sigtrap = kHandleSignalExclusive;
-    // FIXME: enable once all false positives have been fixed.
-    cf.detect_leaks = false;
+    // For now only tested on Linux. Other plantforms can be turned on as they
+    // become ready.
+    cf.detect_leaks = cf.detect_leaks && SANITIZER_LINUX && !SANITIZER_ANDROID;
 
 #if SANITIZER_ANDROID
     // Let platform handle other signals. It is better at reporting them then we