Skip to content

Commit 56d9bb2

Browse files
authored
Revert "[Sanitizers] Intercept timer_create (#112285)"
This reverts commit b373278.
1 parent 4161ca2 commit 56d9bb2

File tree

5 files changed

+0
-52
lines changed

5 files changed

+0
-52
lines changed

compiler-rt/lib/hwasan/hwasan_platform_interceptors.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,6 @@
200200
#undef SANITIZER_INTERCEPT_CLOCK_GETCPUCLOCKID
201201
#define SANITIZER_INTERCEPT_CLOCK_GETCPUCLOCKID 0
202202

203-
#undef SANITIZER_INTERCEPT_TIMER_CREATE
204-
#define SANITIZER_INTERCEPT_TIMER_CREATE 0
205-
206203
#undef SANITIZER_INTERCEPT_GETITIMER
207204
#define SANITIZER_INTERCEPT_GETITIMER 0
208205

compiler-rt/lib/msan/tests/msan_test.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4881,27 +4881,4 @@ TEST(MemorySanitizer, throw_catch) {
48814881
// pass
48824882
}
48834883
}
4884-
4885-
#if defined(__linux__)
4886-
TEST(MemorySanitizer, timer_create) {
4887-
timer_t timer;
4888-
EXPECT_POISONED(timer);
4889-
int res = timer_create(CLOCK_REALTIME, nullptr, &timer);
4890-
ASSERT_EQ(0, res);
4891-
EXPECT_NOT_POISONED(timer);
4892-
4893-
// Make sure the timer is usable.
4894-
struct itimerspec cur_value {};
4895-
cur_value.it_value.tv_sec = 1;
4896-
EXPECT_EQ(0, timer_settime(timer, 0, &cur_value, nullptr));
4897-
4898-
timer_t timer2;
4899-
EXPECT_POISONED(timer2);
4900-
// Use an invalid clock_id to make timer_create fail.
4901-
res = timer_create(INT_MAX, nullptr, &timer2);
4902-
ASSERT_EQ(-1, res);
4903-
EXPECT_POISONED(timer2);
4904-
timer_delete(timer);
4905-
}
4906-
#endif
49074884
} // namespace

compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2289,24 +2289,6 @@ INTERCEPTOR(int, pthread_getcpuclockid, uptr thread,
22892289
#define INIT_CLOCK_GETCPUCLOCKID
22902290
#endif
22912291

2292-
#if SANITIZER_INTERCEPT_TIMER_CREATE
2293-
INTERCEPTOR(int, timer_create, __sanitizer_clockid_t clockid, void *sevp,
2294-
__sanitizer_timer_t *timer) {
2295-
void *ctx;
2296-
COMMON_INTERCEPTOR_ENTER(ctx, timer_create, clockid, sevp, timer);
2297-
int res = REAL(timer_create)(clockid, sevp, timer);
2298-
if (!res && timer) {
2299-
COMMON_INTERCEPTOR_WRITE_RANGE(ctx, timer, sizeof *timer);
2300-
}
2301-
return res;
2302-
}
2303-
2304-
# define INIT_TIMER_CREATE \
2305-
COMMON_INTERCEPT_FUNCTION_GLIBC_VER_MIN(timer_create, "GLIBC_2.3.3");
2306-
#else
2307-
# define INIT_TIMER_CREATE
2308-
#endif
2309-
23102292
#if SANITIZER_INTERCEPT_GETITIMER
23112293
INTERCEPTOR(int, getitimer, int which, void *curr_value) {
23122294
void *ctx;
@@ -10284,7 +10266,6 @@ static void InitializeCommonInterceptors() {
1028410266
INIT_SETPWENT;
1028510267
INIT_CLOCK_GETTIME;
1028610268
INIT_CLOCK_GETCPUCLOCKID;
10287-
INIT_TIMER_CREATE;
1028810269
INIT_GETITIMER;
1028910270
INIT_TIME;
1029010271
INIT_GLOB;

compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,6 @@
237237
(SI_FREEBSD || SI_NETBSD || SI_LINUX || SI_SOLARIS)
238238
#define SANITIZER_INTERCEPT_CLOCK_GETCPUCLOCKID \
239239
(SI_LINUX || SI_FREEBSD || SI_NETBSD)
240-
// TODO: This should be SI_POSIX, adding Linux first until I have time
241-
// to verify all timer_t typedefs on other platforms.
242-
#define SANITIZER_INTERCEPT_TIMER_CREATE SI_LINUX
243240
#define SANITIZER_INTERCEPT_GETITIMER SI_POSIX
244241
#define SANITIZER_INTERCEPT_TIME SI_POSIX
245242
#define SANITIZER_INTERCEPT_GLOB (SI_GLIBC || SI_SOLARIS)

compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,10 +1517,6 @@ extern const int si_SEGV_ACCERR;
15171517

15181518
#define SIGACTION_SYMNAME sigaction
15191519

1520-
# if SANITIZER_LINUX
1521-
typedef void *__sanitizer_timer_t;
1522-
# endif
1523-
15241520
#endif // SANITIZER_LINUX || SANITIZER_APPLE
15251521

15261522
#endif

0 commit comments

Comments
 (0)