diff options
author | Kamil Rytarowski <n54@gmx.com> | 2017-11-21 09:36:07 +0000 |
---|---|---|
committer | Kamil Rytarowski <n54@gmx.com> | 2017-11-21 09:36:07 +0000 |
commit | 258a754d1c235494df54f953d9141d9d781b361a (patch) | |
tree | 8937988bfe56ac4a9597cab92280ecc69c8f46ce /lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc | |
parent | 3bebf4ad20ef294135635a5daafbad572ee9f237 (diff) |
Correct NetBSD support in pthread_once(3)/TSan
Summary:
The pthread_once(3)/NetBSD type is built with the following structure:
struct __pthread_once_st {
pthread_mutex_t pto_mutex;
int pto_done;
};
Set the pto_done position as shifted by __sanitizer::pthread_mutex_t_sz
from the beginning of the pthread_once struct.
This corrects deadlocks when the pthread_once(3) function
is used.
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, dvyukov, vitalybuka
Reviewed By: dvyukov
Subscribers: llvm-commits, kubamracek, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D40262
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@318742 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc b/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc index b973f0d6d..108e196e7 100644 --- a/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc +++ b/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cc @@ -83,6 +83,7 @@ unsigned siginfo_t_sz = sizeof(siginfo_t); unsigned struct_sigaction_sz = sizeof(struct sigaction); unsigned struct_itimerval_sz = sizeof(struct itimerval); unsigned pthread_t_sz = sizeof(pthread_t); +unsigned pthread_mutex_t_sz = sizeof(pthread_mutex_t); unsigned pthread_cond_t_sz = sizeof(pthread_cond_t); unsigned pid_t_sz = sizeof(pid_t); unsigned timeval_sz = sizeof(timeval); |