Index: source/Plugins/Process/Linux/NativeProcessLinux.cpp =================================================================== --- source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -554,7 +554,8 @@ eDupStderrFailed, eChdirFailed, eExecFailed, - eSetGidFailed + eSetGidFailed, + eSetSigMaskFailed }; // Child process. @@ -629,6 +630,12 @@ } } + // Clear the signal mask to prevent the child from being affected by + // any masking done by the parent. + sigset_t set; + if (sigemptyset(&set) != 0 || pthread_sigmask(SIG_SETMASK, &set, nullptr) != 0) + exit(eSetSigMaskFailed); + // Execute. We should never return... execve(argv[0], const_cast(argv), @@ -686,6 +693,9 @@ case eSetGidFailed: error.SetErrorString("Child setgid failed."); break; + case eSetSigMaskFailed: + error.SetErrorString("Child failed to set signal mask."); + break; default: error.SetErrorString("Child returned unknown exit status."); break;