Uninstall handlers for expected crash signals in child processes

Chromium's test launcher installs crash signal handlers which call
exit(1), instead of with the signal value.

Change-Id: I0c1a62100ef59939a6bcfbf0733e746609a1ead8
Reviewed-on: https://chromium-review.googlesource.com/1131819
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
Joshua Peraza 2018-07-11 08:59:41 -07:00 committed by Commit Bot
parent 0c8f035a50
commit fb0f7ca8d7
2 changed files with 6 additions and 1 deletions

View File

@ -89,7 +89,8 @@ class Multiprocess {
//! \param[in] code If \a reason is TerminationReason::kTerminationNormal,
//! this is the expected exit status of the child. If \a reason is
//! TerminationReason::kTerminationSignal, this is the signal that is
//! expected to kill the child.
//! expected to kill the child. On Linux platforms, SIG_DFL will be
//! installed for \a code in the child process.
void SetExpectedChildTermination(TerminationReason reason, int code);
#if !defined(OS_WIN)

View File

@ -143,6 +143,10 @@ void Multiprocess::Run() {
if (exception_swallower.get()) {
ExceptionSwallower::SwallowExceptions();
}
#elif defined(OS_LINUX) || defined(OS_ANDROID)
if (reason_ == kTerminationSignal && Signals::IsCrashSignal(code_)) {
Signals::InstallDefaultHandler(code_);
}
#endif // OS_MACOSX
RunChild();