forked from OSchip/llvm-project
[msan] Fix signal chaining
Return internally stored handlers only if handlers is set to wrapper llvm-svn: 317970
This commit is contained in:
parent
24bc8d5905
commit
5f767113c5
|
@ -1301,7 +1301,7 @@ static int sigaction_impl(int signo, const __sanitizer_sigaction *act,
|
|||
res = REAL(sigaction)(signo, pnew_act, oldact);
|
||||
if (res == 0 && oldact) {
|
||||
uptr cb = (uptr)oldact->sigaction;
|
||||
if (cb != __sanitizer::sig_ign && cb != __sanitizer::sig_dfl) {
|
||||
if (cb == (uptr)SignalAction || cb == (uptr)SignalHandler) {
|
||||
oldact->sigaction = (decltype(oldact->sigaction))old_cb;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
// clang-format on
|
||||
|
||||
// Remove when fixed: https://github.com/google/sanitizers/issues/637
|
||||
// XFAIL: msan
|
||||
|
||||
// XFAIL: tsan
|
||||
|
||||
// Flaky errors in debuggerd with "waitpid returned unexpected pid (0)" in logcat.
|
||||
|
@ -33,7 +33,7 @@ struct sigaction original_sigaction_sigsegv;
|
|||
|
||||
void User_OnSIGSEGV(int signum, siginfo_t *siginfo, void *context) {
|
||||
fprintf(stderr, "User sigaction called\n");
|
||||
struct sigaction original_sigaction;
|
||||
struct sigaction original_sigaction = {};
|
||||
if (signum == SIGBUS)
|
||||
original_sigaction = original_sigaction_sigbus;
|
||||
else if (signum == SIGSEGV)
|
||||
|
@ -58,7 +58,7 @@ int DoSEGV() {
|
|||
}
|
||||
|
||||
bool InstallHandler(int signum, struct sigaction *original_sigaction) {
|
||||
struct sigaction user_sigaction;
|
||||
struct sigaction user_sigaction = {};
|
||||
user_sigaction.sa_sigaction = User_OnSIGSEGV;
|
||||
user_sigaction.sa_flags = SA_SIGINFO;
|
||||
if (sigaction(signum, &user_sigaction, original_sigaction)) {
|
||||
|
|
Loading…
Reference in New Issue