Skip to content

Commit e8cf413

Browse files
authored
Revert "[compiler-rt][rtsan] fopencookie support." (#121537)
Reverts #120864 because it broke building compiler-rt on Mac. https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-mac-arm64/b8726812736235038609/overview
1 parent c1ecc0d commit e8cf413

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 & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,6 @@ INTERCEPTOR(FILE *, fdopen, int fd, const char *mode) {
297297
return REAL(fdopen)(fd, mode);
298298
}
299299

300-
INTERCEPTOR(FILE *, fopencookie, void *cookie, const char *mode,
301-
cookie_io_functions_t funcs) {
302-
__rtsan_notify_intercepted_call("fopencookie");
303-
return REAL(fopencookie)(cookie, mode, funcs);
304-
}
305-
306300
#if SANITIZER_INTERCEPT_OPEN_MEMSTREAM
307301
INTERCEPTOR(FILE *, open_memstream, char **buf, size_t *size) {
308302
__rtsan_notify_intercepted_call("open_memstream");
@@ -978,7 +972,6 @@ void __rtsan::InitializeInterceptors() {
978972
INTERCEPT_FUNCTION(fputs);
979973
INTERCEPT_FUNCTION(fdopen);
980974
INTERCEPT_FUNCTION(freopen);
981-
INTERCEPT_FUNCTION(fopencookie);
982975
RTSAN_MAYBE_INTERCEPT_OPEN_MEMSTREAM;
983976
RTSAN_MAYBE_INTERCEPT_FMEMOPEN;
984977
INTERCEPT_FUNCTION(lseek);

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

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -353,29 +353,6 @@ TEST_F(RtsanFileTest, FopenDiesWhenRealtime) {
353353
ExpectNonRealtimeSurvival(Func);
354354
}
355355

356-
TEST_F(RtsanFileTest, FopenCookieDieWhenRealtime) {
357-
FILE *f = fopen(GetTemporaryFilePath(), "w");
358-
EXPECT_THAT(f, Ne(nullptr));
359-
struct fholder {
360-
FILE *fp;
361-
size_t read;
362-
} fh = {f, 0};
363-
auto CookieRead = [this](void *cookie, char *buf, size_t size) {
364-
fholder *p = reinterpret_cast<fholder *>(cookie);
365-
p->read = fread(static_cast<void *>(buf), 1, size, p->fp);
366-
EXPECT_NE(0, p->read);
367-
};
368-
cookie_io_functions_t funcs = {(cookie_read_function_t *)&CookieRead, nullptr,
369-
nullptr, nullptr};
370-
auto Func = [&fh, &funcs]() {
371-
FILE *f = fopencookie(&fh, "w", funcs);
372-
EXPECT_THAT(f, Ne(nullptr));
373-
};
374-
375-
ExpectRealtimeDeath(Func, "fopencookie");
376-
ExpectNonRealtimeSurvival(Func);
377-
}
378-
379356
#if SANITIZER_INTERCEPT_OPEN_MEMSTREAM
380357
TEST_F(RtsanFileTest, OpenMemstreamDiesWhenRealtime) {
381358
char *buffer;

0 commit comments

Comments
 (0)