[HWASAN] Prevent crashes on thread exit
authorVitaly Buka <vitalybuka@google.com>
Thu, 11 May 2023 17:30:20 +0000 (10:30 -0700)
committerVitaly Buka <vitalybuka@google.com>
Thu, 11 May 2023 23:15:06 +0000 (16:15 -0700)
commit2eda2e013830537800b68c9217fc14ea7704e618
treec6657392bd1a677f6c0262cc7e8eb7a36f91e5a2
parent20a3c6e84e0955ac20762c35e8c2435017ae967d
[HWASAN] Prevent crashes on thread exit

I can't figure out how to reproduce this for test, but I see the case on
random binaries.

The known issue is with GLIBC, others may have a workaround, e.g. Bionic,
https://cs.android.com/android/platform/superproject/+/master:bionic/libc/bionic/pthread_exit.cpp;l=149
see signals blocked above.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D150401
compiler-rt/lib/hwasan/hwasan_linux.cpp