Index: compiler-rt/trunk/lib/esan/esan_interceptors.cpp =================================================================== --- compiler-rt/trunk/lib/esan/esan_interceptors.cpp +++ compiler-rt/trunk/lib/esan/esan_interceptors.cpp @@ -373,6 +373,8 @@ #endif #if SANITIZER_LINUX +DECLARE_REAL(int, sigaction, int signum, const struct sigaction *act, + struct sigaction *oldact) INTERCEPTOR(int, sigaction, int signum, const struct sigaction *act, struct sigaction *oldact) { void *ctx; @@ -382,6 +384,15 @@ else return REAL(sigaction)(signum, act, oldact); } + +// This is required to properly use internal_sigaction. +namespace __sanitizer { +int real_sigaction(int signum, const void *act, void *oldact) { + return REAL(sigaction)(signum, (const struct sigaction *)act, + (struct sigaction *)oldact); +} +} // namespace __sanitizer + #define ESAN_MAYBE_INTERCEPT_SIGACTION INTERCEPT_FUNCTION(sigaction) #else #error Platform not supported Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.h =================================================================== --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.h +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.h @@ -78,6 +78,8 @@ int my_pthread_attr_getstack(void *attr, void **addr, uptr *size); +// A routine named real_sigaction() must be implemented by each sanitizer in +// order for internal_sigaction() to bypass interceptors. int internal_sigaction(int signum, const void *act, void *oldact); void internal_sigfillset(__sanitizer_sigset_t *set);