From a555a99d8dd9cb7726e9ddbf1eb1ec3ee79192de Mon Sep 17 00:00:00 2001 From: Michail Kashkarov Date: Wed, 15 Nov 2017 20:50:30 +0300 Subject: [PATCH] [ASan] Add support for lsan background leak checking thread. Change-Id: I61dbebdecd0f608736e8a1649595868cc119a8e4 --- libsanitizer/asan/asan_rtl.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/libsanitizer/asan/asan_rtl.cc b/libsanitizer/asan/asan_rtl.cc index 8b28e6a..5bafb9a 100644 --- a/libsanitizer/asan/asan_rtl.cc +++ b/libsanitizer/asan/asan_rtl.cc @@ -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); + } } } -- 2.7.4