From fb0f7ca8d7eb55ca51b77eb89813a3283a461b0c Mon Sep 17 00:00:00 2001 From: Joshua Peraza Date: Wed, 11 Jul 2018 08:59:41 -0700 Subject: [PATCH] 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 Commit-Queue: Joshua Peraza --- test/multiprocess.h | 3 ++- test/multiprocess_posix.cc | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test/multiprocess.h b/test/multiprocess.h index aac9288b..d0275020 100644 --- a/test/multiprocess.h +++ b/test/multiprocess.h @@ -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) diff --git a/test/multiprocess_posix.cc b/test/multiprocess_posix.cc index cdb5385e..2e0c3856 100644 --- a/test/multiprocess_posix.cc +++ b/test/multiprocess_posix.cc @@ -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();