gopalshankar / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
0 stars 0 forks source link

Add LSan option to display suppressions used even when no leaks are detected #319

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
LSan only shows information about suppressions used when a leak is detected, 
but it would be nice to have an LSAN_OPTION to always show information about 
these suppressions.

I'm working on getting LSan working with Firefox unit tests, and it would be 
nice to see at a glance what is happening with the suppressions, even if there 
is no unsuppressed leak.

Original issue reported on code.google.com by continua...@gmail.com on 13 Jun 2014 at 9:38

GoogleCodeExporter commented 9 years ago

Original comment by konstant...@gmail.com on 16 Jun 2014 at 7:53

GoogleCodeExporter commented 9 years ago
I thought this is how it works already:

% head t.cc lsan.supp 
==> t.cc <==
int *x;
int main(int argc, char **argv) {
  x = new int[10];
  if (argc)
    x = 0;
}

==> lsan.supp <==
leak:main
% clang++ -fsanitize=address t.cc && 
LSAN_OPTIONS=print_suppressions=true:suppressions=lsan.supp  ./a.out 
-----------------------------------------------------
Suppressions used:
  count      bytes template
      1         40 main
-----------------------------------------------------

Original comment by konstant...@gmail.com on 16 Jun 2014 at 7:59

GoogleCodeExporter commented 9 years ago
The default behavior (print_suppressions=true) is to always print matched 
suppressions. With print_suppressions=false they are never printed. The "print 
matched suppressions only when unsuppressed leaks are present" behavior does 
not exist, as far as I can tell from looking at the code. Is this not what you 
observe?

Original comment by earth...@chromium.org on 16 Jun 2014 at 9:30

GoogleCodeExporter commented 9 years ago
Strange.  I am seeing the "Supressions used" on our test servers, but not when 
I'm running locally.  Something weird must be happening with my test harness 
then.  Sorry about that.

Original comment by continua...@gmail.com on 16 Jun 2014 at 7:18

GoogleCodeExporter commented 9 years ago

Original comment by samso...@google.com on 16 Jun 2014 at 7:28