HomePhabricator

tsan: fix pthread_detach with called_from_lib suppressions

Authored by dvyukov on Feb 19 2020, 5:18 AM.

Description

tsan: fix pthread_detach with called_from_lib suppressions

Generally we ignore interceptors coming from called_from_lib-suppressed libraries.
However, we must not ignore critical interceptors like e.g. pthread_create,
otherwise runtime will lost track of threads.
pthread_detach is one of these interceptors we should not ignore as it affects
thread states and behavior of pthread_join which we don't ignore as well.
Currently we can produce very obscure false positives. For more context see:
https://groups.google.com/forum/#!topic/thread-sanitizer/ecH2P0QUqPs
The added test captures this pattern.

While we are here rename ThreadTid to ThreadConsumeTid to make it clear that
it's not just a "getter", it resets user_id to 0. This lead to confusion recently.

Reviewed in https://reviews.llvm.org/D74828

Details

Committed
dvyukovFeb 26 2020, 3:59 AM
Parents
rG9c859fc54d92: [AArch64][SVE] Add SVE2 intrinsics for bit permutation & table lookup
Branches
Unknown
Tags
Unknown