[compiler-rt] 934140a - [rtsan] Remove mkfifoat interceptor (#116997)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 20 08:28:02 PST 2024
Author: Chris Apple
Date: 2024-11-20T08:27:58-08:00
New Revision: 934140a3353f6d480a01a1f68d42899c926ee056
URL: https://github.com/llvm/llvm-project/commit/934140a3353f6d480a01a1f68d42899c926ee056
DIFF: https://github.com/llvm/llvm-project/commit/934140a3353f6d480a01a1f68d42899c926ee056.diff
LOG: [rtsan] Remove mkfifoat interceptor (#116997)
This partially reverts #116915
[fce917d](https://github.com/llvm/llvm-project/commit/fce917d39d97b8697e04fc52b1727307fc341212)
mkfifoat was improperly guarded against in MacOS systems
Added:
Modified:
compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
compiler-rt/lib/rtsan/tests/rtsan_test_interceptors_posix.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp b/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
index 5ef52d72fceb31..73448cfc117884 100644
--- a/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
+++ b/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
@@ -746,16 +746,6 @@ INTERCEPTOR(int, mkfifo, const char *pathname, mode_t mode) {
return REAL(mkfifo)(pathname, mode);
}
-// see comment above about -Wunguarded-availability-new
-// and why we disable it here
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunguarded-availability-new"
-INTERCEPTOR(int, mkfifoat, int dirfd, const char *pathname, mode_t mode) {
- __rtsan_notify_intercepted_call("mkfifoat");
- return REAL(mkfifoat)(dirfd, pathname, mode);
-}
-#pragma clang diagnostic pop
-
// Preinit
void __rtsan::InitializeInterceptors() {
INTERCEPT_FUNCTION(calloc);
@@ -859,7 +849,6 @@ void __rtsan::InitializeInterceptors() {
INTERCEPT_FUNCTION(pipe);
INTERCEPT_FUNCTION(mkfifo);
- INTERCEPT_FUNCTION(mkfifoat);
}
#endif // SANITIZER_POSIX
diff --git a/compiler-rt/lib/rtsan/tests/rtsan_test_interceptors_posix.cpp b/compiler-rt/lib/rtsan/tests/rtsan_test_interceptors_posix.cpp
index 72f6d819b216c0..3e14346f33c7ca 100644
--- a/compiler-rt/lib/rtsan/tests/rtsan_test_interceptors_posix.cpp
+++ b/compiler-rt/lib/rtsan/tests/rtsan_test_interceptors_posix.cpp
@@ -971,21 +971,6 @@ TEST(TestRtsanInterceptors, MkfifoDiesWhenRealtime) {
ExpectNonRealtimeSurvival(Func);
}
-#if __has_builtin(__builtin_available) && SANITIZER_APPLE
-#define MKFIFOAT_AVAILABLE() (__builtin_available(macOS 10.13, *))
-#else
-// We are going to assume this is true until we hit systems where it isn't
-#define MKFIFOAT_AVAILABLE() (true)
-#endif
-
-TEST(TestRtsanInterceptors, MkfifoatDiesWhenRealtime) {
- if (MKFIFOAT_AVAILABLE()) {
- auto Func = []() { mkfifoat(0, "/tmp/rtsan_test_fifo", 0); };
- ExpectRealtimeDeath(Func, "mkfifoat");
- ExpectNonRealtimeSurvival(Func);
- }
-}
-
TEST(TestRtsanInterceptors, PipeDiesWhenRealtime) {
int fds[2];
auto Func = [&fds]() { pipe(fds); };
More information about the llvm-commits
mailing list