[ASan] Add support for lsan background leak checking thread. 01/160901/4 accepted/tizen_5.0_base tizen_5.0_base accepted/tizen/5.0/base/20181101.090602 accepted/tizen/base/20180924.142600 submit/tizen_5.0_base/20181101.000001 submit/tizen_base/20180921.104459
authorMichail Kashkarov <m.kashkarov@partner.samsung.com>
Wed, 15 Nov 2017 17:50:30 +0000 (20:50 +0300)
committerDongkyun Son <dongkyun.s@samsung.com>
Fri, 21 Sep 2018 07:11:53 +0000 (07:11 +0000)
Change-Id: I61dbebdecd0f608736e8a1649595868cc119a8e4

libsanitizer/asan/asan_rtl.cc

index 8b28e6a..5bafb9a 100644 (file)
@@ -594,11 +594,14 @@ static void AsanInitInternal() {
 
   if (CAN_SANITIZE_LEAKS) {
     __lsan::InitCommonLsan();
-    if (common_flags()->detect_leaks && common_flags()->leak_check_at_exit) {
-      if (flags()->halt_on_error)
-       Atexit(__lsan::DoLeakCheck);
-      else
-       Atexit(__lsan::DoRecoverableLeakCheckVoid);
+    if (common_flags()->detect_leaks) {
+      __lsan::MaybeStartBackgroudLeakCheckingThread();
+      if (common_flags()->leak_check_at_exit) {
+        if (flags()->halt_on_error)
+          Atexit(__lsan::DoLeakCheck);
+        else
+          Atexit(__lsan::DoRecoverableLeakCheckVoid);
+      }
     }
   }