https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115461

--- Comment #5 from Ilya Leoshkevich <iii at linux dot ibm.com> ---
The LLVM testsuite still passes.

Looking a bit deeper:

$ LSAN_OPTIONS=verbosity=1,log_pointers=1 ./a.out
[...]
0x508000000000
==1522380==LeakSanitizer: checking for leaks
[...]
==1522381==Scanning STACK range 0x03ffffffa3d8-0x03ffffffb000.
==1522381==0x03ffffffa820: found 0x508000000000 pointing into chunk
0x508000000000-0x50800000007b of size 123.

So something spilled the pointer value on stack, and LSan thinks that it's
still referenced. And indeed, turning stack scanning off resolves the issue:

$ LSAN_OPTIONS=use_stacks=0 ./a.out
0x508000000000

=================================================================
==1522412==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 123 byte(s) in 1 object(s) allocated from:
    #0 0x2aa00045bbd in malloc
[...]/llvm-project/compiler-rt/lib/lsan/lsan_interceptors.cpp:75:3
    #1 0x2aa0004779d in main ([...]/llvm-project/build/a.out+0x4779d)

SUMMARY: LeakSanitizer: 123 byte(s) leaked in 1 allocation(s).

Reply via email to