[PATCH] D29382: [lsan] Respect default value of detect_leaks flag

Maxim Ostapenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 2 08:57:59 PST 2017

m.ostapenko added a comment.

In https://reviews.llvm.org/D29382#663755, @kcc wrote:

> >> since we would like to have LSan on by default on 64 bit arches and off on 32 bit ones.
> Mmm. Do we? why not have it on by default even on 32-bit? 
>  I remember that I was opposed to even enabling it at all on 32-bit, but if we enable it, let's make the default the same as on 64-bit, to avoid more confusion).

Hm, OK, this is reasonable.

> I assume that there are no false positives on 32-bit, only false negatives.

Yeah. The only thing I'm afraid of is Direct/Indirect leaks distinguishing (on 32 bit arches LSan may report false indirect leaks that are actually direct).
Anyway, I'm going to drop the patch.

Comment at: test/asan/TestCases/Linux/leak.cc:3
 // REQUIRES: leak-detection
kcc wrote:
> why?
Sad story. The value of 't' pointer is spilled to stack before calling printf. And for some reason LSan treats the top frame (that corresponds to main function) as a source of live pointers. This happens because SP value extracted via ptrace has **lower** value than the top address of main function frame.



More information about the llvm-commits mailing list