From 10dcf594d9bd253f3770a893587bd9a7359dbdc4 Mon Sep 17 00:00:00 2001 From: Maxim Ostapenko Date: Mon, 23 Jan 2017 08:45:17 +0000 Subject: [lsan] Enable LSan for x86 Linux. People keep asking LSan to be available on 32 bit targets (e.g. https://github.com/google/sanitizers/issues/403) despite the fact that false negative ratio might be huge (up to 85%). This happens for big real world applications that may contain random binary data (e.g. browser), but for smaller apps situation is not so terrible and LSan still might be useful. This patch adds initial support for x86 Linux (disabled by default), ARM32 is in TODO list. We used this patch (well, ported to GCC) on our 32 bit mobile emulators and it worked pretty fine thus I'm posting it here to initiate further discussion. Differential Revision: https://reviews.llvm.org/D28609 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@292775 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/sanitizer_common/sanitizer_flags.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/sanitizer_common/sanitizer_flags.inc') diff --git a/lib/sanitizer_common/sanitizer_flags.inc b/lib/sanitizer_common/sanitizer_flags.inc index d7fa34a58..d799f6ef7 100644 --- a/lib/sanitizer_common/sanitizer_flags.inc +++ b/lib/sanitizer_common/sanitizer_flags.inc @@ -62,7 +62,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, true, "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 " -- cgit v1.2.1