Bug ID: 78028
           Summary: ASAN doesn't find memory leak
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot
          Reporter: barto at cambridgesemantics dot com
                CC: dodji at gcc dot, dvyukov at gcc dot,
                    jakub at gcc dot, kcc at gcc dot
  Target Milestone: ---

Checking address sanitizer leaks lead me to and the
sample code therein.

I copied/pasted it and ran it on my Ubuntu 14.04 box.
The leak for FooBar was detected and reported.
So I added the suppression file and got no leak reported.
I then removed the allocation code in the FooBar function and still had no
report of a memory leak.

516_ g++ -fsanitize=address
517_ ./a.out

==4471==ERROR: LeakSanitizer: detected memory leaks
519_ ASAN_OPTIONS=detect_leaks=1
LSAN_OPTIONS=suppressions=suppressions=suppr.txt ./a.out
Suppressions used:
  count      bytes template
      1          7 FooBar

But no error for Baz as noted on the webpage. Removing the allocation in FooBar
will then pass without the suppression file applied.

Reply via email to