diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/linux/handler/exception_handler_unittest.cc | 4 | ||||
-rw-r--r-- | src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc | 6 | ||||
-rw-r--r-- | src/common/linux/tests/crash_generator.cc | 6 |
3 files changed, 13 insertions, 3 deletions
diff --git a/src/client/linux/handler/exception_handler_unittest.cc b/src/client/linux/handler/exception_handler_unittest.cc index 3040e0f1..2a080607 100644 --- a/src/client/linux/handler/exception_handler_unittest.cc +++ b/src/client/linux/handler/exception_handler_unittest.cc @@ -421,6 +421,10 @@ TEST(ExceptionHandlerTest, RedeliveryToDefaultHandler) { const pid_t child = fork(); if (child == 0) { + // Custom signal handlers, which may have been installed by a test launcher, + // are undesirable in this child. + signal(SIGSEGV, SIG_DFL); + CrashWithCallbacks(FilterCallbackReturnFalse, NULL, temp_dir.path()); } diff --git a/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc b/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc index a4a0fd9b..3060327f 100644 --- a/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc +++ b/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc @@ -144,8 +144,8 @@ class LinuxPtraceDumperChildTest : public testing::Test { if (child_pid_ == 0) { // child process RealTestBody(); - exit(HasFatalFailure() ? kFatalFailure : - (HasNonfatalFailure() ? kNonFatalFailure : 0)); + _exit(HasFatalFailure() ? kFatalFailure : + (HasNonfatalFailure() ? kNonFatalFailure : 0)); } ASSERT_TRUE(child_pid_ > 0); @@ -250,7 +250,7 @@ void LinuxPtraceDumperMappingsTest::SetUp() { helper_path_ = GetHelperBinary(); if (helper_path_.empty()) { FAIL() << "Couldn't find helper binary"; - exit(1); + _exit(1); } // mmap two segments out of the helper binary, one diff --git a/src/common/linux/tests/crash_generator.cc b/src/common/linux/tests/crash_generator.cc index dd681139..36319676 100644 --- a/src/common/linux/tests/crash_generator.cc +++ b/src/common/linux/tests/crash_generator.cc @@ -184,6 +184,12 @@ bool CrashGenerator::CreateChildCrash( pid_t pid = fork(); if (pid == 0) { + // Custom signal handlers, which may have been installed by a test launcher, + // are undesirable in this child. + if (signal(crash_signal, SIG_DFL) == SIG_ERR) { + perror("CrashGenerator: signal"); + exit(1); + } if (chdir(temp_dir_.path().c_str()) == -1) { perror("CrashGenerator: Failed to change directory"); exit(1); |