forked from OSchip/llvm-project
Partially revert r154390 (http://llvm.org/viewvc/llvm-project?view=rev&revision=154390)
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:
parent
64104f16d4
commit
ec316e5940
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue