Switch on detect_leaks on 64-bit platforms by default 27/138927/2
authorSlava Barinov <v.barinov@samsung.com>
Fri, 14 Jul 2017 08:25:35 +0000 (11:25 +0300)
committerDongkyun Son <dongkyun.s@samsung.com>
Thu, 3 Aug 2017 00:29:42 +0000 (00:29 +0000)
       libsanitizer/
       * asan/asan_flags.cc: Switch on leak detection for 64-bit target.
       * lsan/lsan.cc: Likewise.
       * sanitizer_common/sanitizer_flags.inc: Likewise.

Neither the OBS build nor sanitized firmware build are affected.

When Tizen application developer enables ASan for his own package only and run
it in 64-bit emulator (without any additional setup) ASan will report leaks
additionally to all other error messages.

Change-Id: Id16017e9bbe5221778330287c707bdf1846f0760
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
libsanitizer/asan/asan_flags.cc
libsanitizer/lsan/lsan.cc
libsanitizer/sanitizer_common/sanitizer_flags.inc

index 4f87cd2..93ac1d5 100644 (file)
@@ -59,7 +59,7 @@ void InitializeFlags() {
   {
     CommonFlags cf;
     cf.CopyFrom(*common_flags());
-    cf.detect_leaks = false;
+    cf.detect_leaks = (SANITIZER_WORDSIZE == 64);
     cf.external_symbolizer_path = GetEnv("ASAN_SYMBOLIZER_PATH");
     cf.malloc_context_size = kDefaultMallocContextSize;
     cf.intercept_tls_get_addr = true;
index 33051ce..07ca472 100644 (file)
@@ -56,7 +56,7 @@ static void InitializeFlags() {
     cf.CopyFrom(*common_flags());
     cf.external_symbolizer_path = GetEnv("LSAN_SYMBOLIZER_PATH");
     cf.malloc_context_size = 30;
-    cf.detect_leaks = false;
+    cf.detect_leaks = (SANITIZER_WORDSIZE == 64);
     cf.exitcode = 0;
     OverrideCommonFlags(cf);
   }
index 7d95196..88123cc 100644 (file)
@@ -60,7 +60,8 @@ COMMON_FLAG(
 COMMON_FLAG(
     int, verbosity, 0,
     "Verbosity level (0 - silent, 1 - a bit of output, 2+ - more output).")
-COMMON_FLAG(bool, detect_leaks, false, "Enable memory leak detection.")
+COMMON_FLAG(bool, detect_leaks, (SANITIZER_WORDSIZE == 64),
+           "Enable memory leak detection.")
 COMMON_FLAG(
     bool, leak_check_at_exit, true,
     "Invoke leak checking in an atexit handler. Has no effect if "