Peng Yu via llvm-dev
2021-Apr-20 22:40 UTC
[llvm-dev] Does -fsanitize=address cover -fsanitize=leak?
Hi, I see this page offers confusing information. The example uses -fsanitize=address, but the text below it says -fsanitize=leak. When I tried it, it seems that both -fsanitize=leak and -fsanitize=address are fine? So should -fsanitize=address be used instead -fsanitize=leak as the former covers more than the latter? Thanks. https://clang.llvm.org/docs/LeakSanitizer.html -- Regards, Peng
Fangrui Song via llvm-dev
2021-Apr-20 23:30 UTC
[llvm-dev] Does -fsanitize=address cover -fsanitize=leak?
On 2021-04-20, Peng Yu via llvm-dev wrote:>Hi, > >I see this page offers confusing information. The example uses >-fsanitize=address, but the text below it says -fsanitize=leak. > >When I tried it, it seems that both -fsanitize=leak and >-fsanitize=address are fine? So should -fsanitize=address be used >instead -fsanitize=leak as the former covers more than the latter? >Thanks. > >https://clang.llvm.org/docs/LeakSanitizer.htmlThe doc is outdated. I submitted https://reviews.llvm.org/D100907 to update the supported platforms and clarify this sentence. If the executable is linked with -fsanitize=address, indeed it gets LeakSanitizer by default. See CAN_SANITIZE_LEAKS in compiler-rt/lib/asan/asan_rtl.cpp> >-- >Regards, >Peng >_______________________________________________ >LLVM Developers mailing list >llvm-dev at lists.llvm.org >https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev