[compiler-rt] 87369c6 - Revert "[tsan] Add pthread_cond_clockwait interceptor"
Wolfgang Pieb via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 18 11:59:14 PST 2020
Author: Wolfgang Pieb
Date: 2020-11-18T11:58:45-08:00
New Revision: 87369c626114ae17f4c637635c119e6de0856a9a
URL: https://github.com/llvm/llvm-project/commit/87369c626114ae17f4c637635c119e6de0856a9a
DIFF: https://github.com/llvm/llvm-project/commit/87369c626114ae17f4c637635c119e6de0856a9a.diff
LOG: Revert "[tsan] Add pthread_cond_clockwait interceptor"
This reverts commit 16eb853ffdd1a1ad7c95455b7795c5f004402e46.
The test is failing on some Linux build bots. See the review for
an example.
Added:
Modified:
compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
Removed:
compiler-rt/test/tsan/Linux/clockwait_double_lock.c
################################################################################
diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
index 7a731df34d80..74e6ae6ea74a 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
@@ -1202,21 +1202,6 @@ INTERCEPTOR(int, pthread_cond_timedwait, void *c, void *m, void *abstime) {
m);
}
-#if SANITIZER_LINUX
-INTERCEPTOR(int, pthread_cond_clockwait, void *c, void *m,
- __sanitizer_clockid_t clock, void *abstime) {
- void *cond = init_cond(c);
- SCOPED_TSAN_INTERCEPTOR(pthread_cond_clockwait, cond, m, clock, abstime);
- return cond_wait(
- thr, pc, &si,
- [=]() { return REAL(pthread_cond_clockwait)(cond, m, clock, abstime); },
- cond, m);
-}
-#define TSAN_MAYBE_PTHREAD_COND_CLOCKWAIT TSAN_INTERCEPT(pthread_cond_clockwait)
-#else
-#define TSAN_MAYBE_PTHREAD_COND_CLOCKWAIT
-#endif
-
#if SANITIZER_MAC
INTERCEPTOR(int, pthread_cond_timedwait_relative_np, void *c, void *m,
void *reltime) {
@@ -2731,8 +2716,6 @@ void InitializeInterceptors() {
TSAN_INTERCEPT_VER(pthread_cond_timedwait, PTHREAD_ABI_BASE);
TSAN_INTERCEPT_VER(pthread_cond_destroy, PTHREAD_ABI_BASE);
- TSAN_MAYBE_PTHREAD_COND_CLOCKWAIT;
-
TSAN_INTERCEPT(pthread_mutex_init);
TSAN_INTERCEPT(pthread_mutex_destroy);
TSAN_INTERCEPT(pthread_mutex_trylock);
diff --git a/compiler-rt/test/tsan/Linux/clockwait_double_lock.c b/compiler-rt/test/tsan/Linux/clockwait_double_lock.c
deleted file mode 100644
index 8378fc3c7c82..000000000000
--- a/compiler-rt/test/tsan/Linux/clockwait_double_lock.c
+++ /dev/null
@@ -1,31 +0,0 @@
-// Regression test for https://github.com/google/sanitizers/issues/1259
-// RUN: %clang_tsan -O1 %s -o %t && %run %t
-
-#define _GNU_SOURCE
-#include <pthread.h>
-
-pthread_cond_t cv;
-pthread_mutex_t mtx;
-
-void *fn(void *vp) {
- pthread_mutex_lock(&mtx);
- pthread_cond_signal(&cv);
- pthread_mutex_unlock(&mtx);
- return NULL;
-}
-
-int main() {
- pthread_mutex_lock(&mtx);
-
- pthread_t tid;
- pthread_create(&tid, NULL, fn, NULL);
-
- struct timespec ts;
- clock_gettime(CLOCK_MONOTONIC, &ts);
- ts.tv_sec += 10;
- pthread_cond_clockwait(&cv, &mtx, CLOCK_MONOTONIC, &ts);
- pthread_mutex_unlock(&mtx);
-
- pthread_join(tid, NULL);
- return 0;
-}
More information about the llvm-commits
mailing list