summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2017-11-21 09:36:07 +0000
committerKamil Rytarowski <n54@gmx.com>2017-11-21 09:36:07 +0000
commitd7c85137aa392e8879dd7d37f3bb951def683e08 (patch)
tree633f5a159d50a0b55107c20d60d8875ff1152fea /compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
parent7ca5e5873616c56f6ce473588a303af143b553f1 (diff)
downloadbcm5719-llvm-d7c85137aa392e8879dd7d37f3bb951def683e08.tar.gz
bcm5719-llvm-d7c85137aa392e8879dd7d37f3bb951def683e08.zip
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 llvm-svn: 318742
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc')
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
index dd02b9b3c47..f12e8206abe 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
@@ -210,6 +210,7 @@ namespace __sanitizer {
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);
OpenPOWER on IntegriCloud