Skip to content

Commit 31c1828

Browse files
committed
Revert "[rtsan][Apple] Add interceptor for _os_nospin_lock_lock (llvm#131034)"
This reverts commit 481a55a.
1 parent 215789d commit 31c1828

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed

compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@
3030
extern "C" {
3131
typedef int32_t OSSpinLock;
3232
void OSSpinLockLock(volatile OSSpinLock *__lock);
33-
// A pointer to this type is in the interface for `_os_nospin_lock_lock`, but
34-
// it's an internal implementation detail of `os/lock.c` on Darwin, and
35-
// therefore not available in any headers. As a workaround, we forward declare
36-
// it here, which is enough to facilitate interception of _os_nospin_lock_lock.
37-
struct _os_nospin_lock_s;
38-
using _os_nospin_lock_t = _os_nospin_lock_s *;
3933
}
4034
#endif // TARGET_OS_MAC
4135

@@ -721,11 +715,6 @@ INTERCEPTOR(void, os_unfair_lock_lock, os_unfair_lock_t lock) {
721715
__rtsan_notify_intercepted_call("os_unfair_lock_lock");
722716
return REAL(os_unfair_lock_lock)(lock);
723717
}
724-
725-
INTERCEPTOR(void, _os_nospin_lock_lock, _os_nospin_lock_t lock) {
726-
__rtsan_notify_intercepted_call("_os_nospin_lock_lock");
727-
return REAL(_os_nospin_lock_lock)(lock);
728-
}
729718
#define RTSAN_MAYBE_INTERCEPT_OS_UNFAIR_LOCK_LOCK \
730719
INTERCEPT_FUNCTION(os_unfair_lock_lock)
731720
#else

compiler-rt/lib/rtsan/tests/rtsan_test_interceptors_posix.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,25 +1131,6 @@ TEST(TestRtsanInterceptors, OsUnfairLockLockDiesWhenRealtime) {
11311131
ExpectRealtimeDeath(Func, "os_unfair_lock_lock");
11321132
ExpectNonRealtimeSurvival(Func);
11331133
}
1134-
1135-
// We intercept _os_nospin_lock_lock because it's the internal
1136-
// locking mechanism for MacOS's atomic implementation for data
1137-
// types that are larger than the hardware's maximum lock-free size.
1138-
// However, it's a private implementation detail and not visible in any headers,
1139-
// so we must duplicate the required type definitions to forward declaration
1140-
// what we need here.
1141-
extern "C" {
1142-
struct _os_nospin_lock_s {
1143-
unsigned int oul_value;
1144-
};
1145-
void _os_nospin_lock_lock(_os_nospin_lock_s *);
1146-
}
1147-
TEST(TestRtsanInterceptors, OsNoSpinLockLockDiesWhenRealtime) {
1148-
_os_nospin_lock_s lock{};
1149-
auto Func = [&]() { _os_nospin_lock_lock(&lock); };
1150-
ExpectRealtimeDeath(Func, "_os_nospin_lock_lock");
1151-
ExpectNonRealtimeSurvival(Func);
1152-
}
11531134
#endif
11541135

11551136
#if SANITIZER_LINUX

0 commit comments

Comments
 (0)