diff options
| author | Alexander Potapenko <glider@google.com> | 2014-09-04 09:34:22 +0000 |
|---|---|---|
| committer | Alexander Potapenko <glider@google.com> | 2014-09-04 09:34:22 +0000 |
| commit | 9d24aa0fa8bdcfa1c6a061d97f7abcbeeb6b4177 (patch) | |
| tree | f6b2adab69caa14e92215cd6070cc8534cb86268 /compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc | |
| parent | 2e5134f8f4b2656c2e6cf2f7d7851415db041cf7 (diff) | |
| download | bcm5719-llvm-9d24aa0fa8bdcfa1c6a061d97f7abcbeeb6b4177.tar.gz bcm5719-llvm-9d24aa0fa8bdcfa1c6a061d97f7abcbeeb6b4177.zip | |
[ASan] allow deadly signals to be received in signal handlers
(previously ASan would just crash upon the second SEGV)
Other tools do not use this code yet.
llvm-svn: 217137
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc')
| -rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc b/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc index e79563a2f84..b5b24634ffe 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc @@ -148,7 +148,9 @@ static void MaybeInstallSigaction(int signum, struct sigaction sigact; internal_memset(&sigact, 0, sizeof(sigact)); sigact.sa_sigaction = (sa_sigaction_t)handler; - sigact.sa_flags = SA_SIGINFO; + // Do not block the signal from being received in that signal's handler. + // Clients are responsible for handling this correctly. + sigact.sa_flags = SA_SIGINFO | SA_NODEFER; if (common_flags()->use_sigaltstack) sigact.sa_flags |= SA_ONSTACK; CHECK_EQ(0, internal_sigaction(signum, &sigact, 0)); VReport(1, "Installed the sigaction for signal %d\n", signum); |

