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 | d7c85137aa392e8879dd7d37f3bb951def683e08 (patch) | |
| tree | 633f5a159d50a0b55107c20d60d8875ff1152fea /compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc | |
| parent | 7ca5e5873616c56f6ce473588a303af143b553f1 (diff) | |
| download | bcm5719-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.cc | 1 |
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); |

