Chromium Code Reviews| Index: base/process/process_util_unittest.cc |
| diff --git a/base/process/process_util_unittest.cc b/base/process/process_util_unittest.cc |
| index 6c1a3f1d7619d2b128efb58b6c810c2c79023eae..f81b54efd9749da568788b09ce850dcc993a38f9 100644 |
| --- a/base/process/process_util_unittest.cc |
| +++ b/base/process/process_util_unittest.cc |
| @@ -59,6 +59,9 @@ |
| #include <malloc/malloc.h> |
| #include "base/mac/mac_util.h" |
| #endif |
| +#if defined(OS_ANDROID) |
| +#include "third_party/lss/linux_syscall_support.h" |
| +#endif |
| using base::FilePath; |
| @@ -226,9 +229,21 @@ const char kSignalFileCrash[] = "CrashingChildProcess.die"; |
| MULTIPROCESS_TEST_MAIN(CrashingChildProcess) { |
| WaitToDie(ProcessUtilTest::GetSignalFilePath(kSignalFileCrash).c_str()); |
| -#if defined(OS_POSIX) |
| // Have to disable to signal handler for segv so we can get a crash |
| // instead of an abnormal termination through the crash dump handler. |
|
Nico
2015/07/20 23:44:07
keep this with the ::signal call in the elif posix
|
| +#if defined(OS_ANDROID) |
| + // Android L+ expose signal and sigaction symbols that override the system |
| + // ones. There is a bug in these functions where a request to set the handler |
| + // to SIG_DFL is ignored. In that case, an infinite loop is entered as the |
| + // signal is repeatedly sent to the crash dump signal handler. |
| + // To work around this, directly call the system's sigaction. |
|
Nico
2015/07/20 23:44:07
whaaaaaaaat that is horrible
Primiano Tucci (use gerrit)
2015/07/21 09:04:11
Yes, it is, but to the best of my knowledge this i
|
| + struct kernel_sigaction sa; |
| + memset(&sa, 0, sizeof(sa)); |
| + sys_sigemptyset(&sa.sa_mask); |
| + sa.sa_handler_ = SIG_DFL; |
| + sa.sa_flags = SA_RESTART; |
| + sys_rt_sigaction(SIGSEGV, &sa, NULL, sizeof(kernel_sigset_t)); |
| +#elif defined(OS_POSIX) |
| ::signal(SIGSEGV, SIG_DFL); |
| #endif |
| // Make this process have a segmentation fault. |