summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichail Kashkarov <m.kashkarov@partner.samsung.com>2017-11-15 20:50:30 +0300
committerDongkyun Son <dongkyun.s@samsung.com>2017-12-27 10:26:07 +0900
commit4de2963ea2ecd22ab01f8849b830cbdcd75e2a69 (patch)
tree765d6f2598b3952736dcb1cd5e0c3ac8c294802d
parent20be925916db081c8a4daabecf9fdf78e3d367ab (diff)
downloadlinaro-gcc-sandbox/dkson95/lsan.tar.gz
linaro-gcc-sandbox/dkson95/lsan.tar.bz2
linaro-gcc-sandbox/dkson95/lsan.zip
[ASan] Add support for lsan background leak checking thread.sandbox/dkson95/lsan
Change-Id: I61dbebdecd0f608736e8a1649595868cc119a8e4
-rw-r--r--libsanitizer/asan/asan_rtl.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/libsanitizer/asan/asan_rtl.cc b/libsanitizer/asan/asan_rtl.cc
index 8b28e6aa247..5bafb9a78cf 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);
+ }
}
}