Until we work out the solution for http://code.google.com/p/address-sanitizer/issues/detail?id=65 we'd better not allow
the clients to override AddressSanitizer's signal handler.

The second part of r154390 (removing the sighandler-related tests) is not reverted, because those tests were broken
and didn't test anything.

llvm-svn: 154803
This commit is contained in:
Alexander Potapenko 2012-04-16 08:33:01 +00:00
parent 64104f16d4
commit ec316e5940
1 changed files with 6 additions and 8 deletions

View File

@ -339,21 +339,19 @@ INTERCEPTOR(int, pthread_create, void *thread,
#endif // !_WIN32
#if ASAN_INTERCEPT_SIGNAL_AND_SIGACTION
const char kOverrideSighandlerWarning[] =
"Warning: client program overrides the handler for signal %d.\n";
INTERCEPTOR(void*, signal, int signum, void *handler) {
if (AsanInterceptsSignal(signum)) {
Report(kOverrideSighandlerWarning, signum);
if (!AsanInterceptsSignal(signum)) {
return REAL(signal)(signum, handler);
}
return REAL(signal)(signum, handler);
return NULL;
}
INTERCEPTOR(int, sigaction, int signum, const struct sigaction *act,
struct sigaction *oldact) {
if (AsanInterceptsSignal(signum)) {
Report(kOverrideSighandlerWarning, signum);
if (!AsanInterceptsSignal(signum)) {
return REAL(sigaction)(signum, act, oldact);
}
return REAL(sigaction)(signum, act, oldact);
return 0;
}
#elif ASAN_POSIX
// We need to have defined REAL(sigaction) on posix systems.