Skip to content

Commit 875491f

Browse files
[rtsan][compiler-rt] Fix ioctl test causing segfault on exit (llvm#151182)
I was observing segfaults at executable exit in the rtsan instrumented unit tests. Bisecting the offending test led to observing that this test is not using our safe test fixture for anything involving a file descriptor. Changing to use the fixture eliminated the segfault on exit.
1 parent e1e312e commit 875491f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,8 +752,8 @@ TEST_F(RtsanOpenedFileTest, RewindDieWhenRealtime) {
752752
}
753753
#endif
754754

755-
TEST(TestRtsanInterceptors, IoctlDiesWhenRealtime) {
756-
auto Func = []() { ioctl(0, FIONREAD); };
755+
TEST_F(RtsanOpenedFileTest, IoctlDiesWhenRealtime) {
756+
auto Func = [this]() { ioctl(GetOpenFd(), FIONREAD); };
757757
ExpectRealtimeDeath(Func, "ioctl");
758758
ExpectNonRealtimeSurvival(Func);
759759
}

0 commit comments

Comments
 (0)