-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Asan false positive: string literal ODR-rule violation with Clang -flto #647
Comments
FTR this is the reason ODR violation detection is disabled in GCC. |
Thanks for the report, reproduced. @ygribov-samsung, are you sure this is the same bug as in the above comment? |
I think so, check HJ's and Jakub's comments about -fmerge-all-constants and
|
Is http://reviews.llvm.org/D15642 going to help? |
I'll check it out. |
I've checked the testcase (I needed to modify build.sh) with http://reviews.llvm.org/D15642 and http://reviews.llvm.org/D15644 and ODR violation error seems to disappear:
The only issue here -- clang ICEd to compile test-{1, 2}.cpp with -mllvm -asan-use-private-alias=0 that I'm investigating now. |
Fixed on trunk if use
So, perhaps we can close this? |
Does it still break with ASAN_OPTIONS=use_odr_indicator=2? ASAN_OPTIONS=use_odr_indicator=1 works, even with 3.7.1. The reason is becuase ASAN_OPTIONS=use_odr_indicator=1 only detects ODR violations if the sizes of the objects are different. ASAN_OPTIONS=use_odr_indicator=2 detects ODR violations even when the sizes are the same. |
No-no, you have just mixed up |
…ODR false positive with LTO (llvm part) The '-asan-use-private-alias’ option (disabled by default) option is currently only enabled for Linux and ELF, but it also works on Darwin and Mach-O. This option also fixes a known problem with LTO on Darwin (google/sanitizers#647). This patch enables the support for Darwin (but still keeps it off by default) and adds the LTO test case. Differential Revision: https://reviews.llvm.org/D24292 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281470 91177308-0d34-0410-b5e6-96231b3b80d8
…ODR false positive with LTO (llvm part) The '-asan-use-private-alias’ option (disabled by default) option is currently only enabled for Linux and ELF, but it also works on Darwin and Mach-O. This option also fixes a known problem with LTO on Darwin (google/sanitizers#647). This patch enables the support for Darwin (but still keeps it off by default) and adds the LTO test case. Differential Revision: https://reviews.llvm.org/D24292 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281470 91177308-0d34-0410-b5e6-96231b3b80d8
…ODR false positive with LTO (llvm part) The '-asan-use-private-alias’ option (disabled by default) option is currently only enabled for Linux and ELF, but it also works on Darwin and Mach-O. This option also fixes a known problem with LTO on Darwin (google/sanitizers#647). This patch enables the support for Darwin (but still keeps it off by default) and adds the LTO test case. Differential Revision: https://reviews.llvm.org/D24292 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281470 91177308-0d34-0410-b5e6-96231b3b80d8
…ODR false positive with LTO (llvm part) The '-asan-use-private-alias’ option (disabled by default) option is currently only enabled for Linux and ELF, but it also works on Darwin and Mach-O. This option also fixes a known problem with LTO on Darwin (google/sanitizers#647). This patch enables the support for Darwin (but still keeps it off by default) and adds the LTO test case. Differential Revision: https://reviews.llvm.org/D24292 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281470 91177308-0d34-0410-b5e6-96231b3b80d8
…ODR false positive with LTO (compiler-rt part) The '-asan-use-private-alias’ option (disabled by default) option is currently only enabled for Linux and ELF, but it also works on Darwin and Mach-O. This option also fixes a known problem with LTO on Darwin (google/sanitizers#647). This patch enables the support for Darwin (but still keeps it off by default) and adds the LTO test case. Differential Revision: https://reviews.llvm.org/D24292 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281472 91177308-0d34-0410-b5e6-96231b3b80d8
Merging with #398. |
Building a program with the same string literal in two translation units, and linking with -flto generates a false positive ODR-rule violation:
Address Sanitizer Output
Clang Version
odrlto.zip
The text was updated successfully, but these errors were encountered: