HomeFreeBSD

Apply fix for ThreadSanitizer false positive data race reports

Description

Apply fix for ThreadSanitizer false positive data race reports

Merge commit 28fb22c90fe7 from llvm git (by Dimitry Andric):

[TSan] Handle FreeBSD specific indirection of libpthread functions

Similar to 60cc1d3218fc for NetBSD, add aliases and interceptors for the
following pthread related functions:

- pthread_cond_init(3)
- pthread_cond_destroy(3)
- pthread_cond_signal(3)
- pthread_cond_broadcast(3)
- pthread_cond_wait(3)
- pthread_mutex_init(3)
- pthread_mutex_destroy(3)
- pthread_mutex_lock(3)
- pthread_mutex_trylock(3)
- pthread_mutex_unlock(3)
- pthread_rwlock_init(3)
- pthread_rwlock_destroy(3)
- pthread_rwlock_rdlock(3)
- pthread_rwlock_tryrdlock(3)
- pthread_rwlock_wrlock(3)
- pthread_rwlock_trywrlock(3)
- pthread_rwlock_unlock(3)
- pthread_once(3)
- pthread_sigmask(3)

In FreeBSD's libc, a number of internal aliases of the pthread functions
are invoked, typically with an additional prefixed underscore, e.g.
_pthread_cond_init() and so on.

ThreadSanitizer needs to intercept these aliases too, otherwise some
false positive reports about data races might be produced.

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D119034

MFC after: 3 days

(cherry picked from commit 1c21bfb1b1a368f9833b9fb84ed323eeb58c5d4c)

Details

Provenance
dimAuthored on Feb 7 2022, 6:39 PM
Parents
rGf3cdcf235966: elfctl: update man page example for 'no' prefix
Branches
Unknown
Tags
Unknown