Closed Kojoley closed 5 years ago
Hi, thanks for the report.
We know that thread_specific_ptr is broken since a long time, but we don't know how to fix it.
Any help is welcome, a PR, any aditional analysis, ...
Sigh, I thought it is something new because previously I did not see the problem (I found it via Spirit), it should be a new feature in UBSAN or the problem did show up without adding a -fno-sanitize-recover=undefined
flag.
I feel like it is a bug in UBSAN, but I may be wrong because I did not succeeded in making a MWE. With #237 UBSAN is happy, but I am not sure why it works.
This is likely a false positive caused by hidden visibility. Use visibility=global
on UBsan runs.
@pdimov You are right, the problem is gone if I add visibility=global
. Is it a known limitation or it is needed to be reported?
According to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80963
it's not clear if UBsan is correct here or not; in principle, with hidden visibility, two base classes of the same name exist in the program, but in C++ this can't be true due to ODR.
In either case, this is a known issue - here's @mclow encountering it in 2013: https://cplusplusmusings.wordpress.com/2013/03/26/testing-libc-with-fsanitizeundefined/
I just add visibility=global
to the UBsan configurations. :-)
In either case, this is a known issue - here's @mclow encountering it in 2013: cplusplusmusings.wordpress.com/2013/03/26/testing-libc-with-fsanitizeundefined
If https://www.boost.org/development/tests/develop/Marshall-UBSAN.html is his worker, then he himself forgot about it.
@pdimov The GCC guys think it is not a false positive, but ODR rules violation https://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg534862.html
That's the same bug I linked above. :-)
Hah, I am blind :-)
What do you think about placing __attribute__((visibility("default")))
on interface classes?
I'm not going to do that. visibility=global
on UBsan runs is good enough for me. Having two identical definitions doesn't violate ODR, by the definition of ODR.
Do we have some conclusion for this issue?
I have opened a ticket on LLVM bugtracker but by this time it has no response https://bugs.llvm.org/show_bug.cgi?id=39191
./b2 -j2 toolset=clang-7 cxxflags="-fsanitize=undefined -fno-sanitize-recover=undefined" linkflags="-fsanitize=undefined" libs/thread/test//ex_tss -a
Update: