summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKuba Mracek <mracek@apple.com>2017-03-30 15:48:25 +0000
committerKuba Mracek <mracek@apple.com>2017-03-30 15:48:25 +0000
commitee2f75fcfd47f41d2113e831cb10fa5828b1f84b (patch)
treea0f59c606568c0388af10605944831a46e1acfb3 /lib
parente17862e22900583883fc7f1b97b561aa4e18593e (diff)
[tsan] Add interceptor for xpc_connection_cancel to avoid false positives
TSan reports a false positive when using xpc_connection_cancel. We're missing a happens-before edge from xpc_connection_cancel to the event handler on the same connection. Differential Revision: https://reviews.llvm.org/D31475 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299086 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/tsan/rtl/tsan_interceptors_mac.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/tsan/rtl/tsan_interceptors_mac.cc b/lib/tsan/rtl/tsan_interceptors_mac.cc
index fc5eb0499..f6bf8a0e5 100644
--- a/lib/tsan/rtl/tsan_interceptors_mac.cc
+++ b/lib/tsan/rtl/tsan_interceptors_mac.cc
@@ -281,6 +281,12 @@ TSAN_INTERCEPTOR(void, xpc_connection_send_message_with_reply,
(connection, message, replyq, new_handler);
}
+TSAN_INTERCEPTOR(void, xpc_connection_cancel, xpc_connection_t connection) {
+ SCOPED_TSAN_INTERCEPTOR(xpc_connection_cancel, connection);
+ Release(thr, pc, (uptr)connection);
+ REAL(xpc_connection_cancel)(connection);
+}
+
// On macOS, libc++ is always linked dynamically, so intercepting works the
// usual way.
#define STDCXX_INTERCEPTOR TSAN_INTERCEPTOR