[compiler-rt] [sanitizer] Fix asserts in asan and tsan in pthread interceptors. (PR #75394)

via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 19 06:12:56 PST 2023


goussepi wrote:

> It's not critical for this component to mismatch join
> 
> However, it could be nice to see example why keeping the bug in the program is needed? Obvious danger of this is thread reuse, and you are joining alive but wrong thread. Sanitizer does not detect that, but if you hit this CHECK, it's possible.
> 
> Maybe rather introduce `detect_invalid_join` into `sanitizer_flags.inc`, set it true by default, and for let users disable it? Would you like to do that? If not, please add TODO near the current CHECK

The error report I got was for pthread_join being called unconditionally inside a destructor.
I agree they are bugs but users see a crash and it can end up being reported as a sanitizer issue.
Adding a flag such as detect_invalid_join sounds good, and using Report() + Die() rather than a CHECK ?

Many thanks!

Pierre

https://github.com/llvm/llvm-project/pull/75394


More information about the llvm-commits mailing list