Skip to content

Commit

Permalink
Revert of Fix ProcessUtilTest.GetTerminationStatusCrash on Android L+…
Browse files Browse the repository at this point in the history
… (patchset #2 id:20001 of https://codereview.chromium.org/1241333002/)

Reason for revert:
This patch broke the mips builder for Android

../../third_party/lss/linux_syscall_support.h:121:21: fatal error: sgidefs.h: No
such file or directory
 #include <sgidefs.h>

Original issue's description:
> Fix ProcessUtilTest.GetTerminationStatusCrash on Android L+
>
> On Android L+, signal and sigaction symbols are provided by libsigchain
> that override the system's versions. There is a bug in these functions
> where they essentially ignore requests to install SIG_DFL. This causes
> ProcessUtilTest.GetTerminationStatusCrash to fail (as
> CrashingChildProcess goes into infinite loop instead of crashing).
>
> Workaround this issue by explicitly performing a syscall to
> __NR_rt_sigaction to install SIG_DFL on Android, as breakpad does
> (see https://breakpad.appspot.com/1804002/).
>
> BUG=512255
> TEST=ProcessUtilTest.GetTerminationStatusCrash
>
> Committed: https://crrev.com/31510fe3e2d3b1f3123f391db52372b2506c46ca
> Cr-Commit-Position: refs/heads/master@{#339584}

[email protected],[email protected],[email protected]
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=512255

Review URL: https://codereview.chromium.org/1247023002

Cr-Commit-Position: refs/heads/master@{#339668}
  • Loading branch information
michaelbai authored and JulienIsorce committed Jul 27, 2015
1 parent 9ea1280 commit 9c811fb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
1 change: 0 additions & 1 deletion base/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ include_rules = [
"+third_party/apple_apsl",
"+third_party/libevent",
"+third_party/dmg_fp",
"+third_party/lss",
"+third_party/mach_override",
"+third_party/modp_b64",
"+third_party/tcmalloc",
Expand Down
17 changes: 1 addition & 16 deletions base/process/process_util_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
#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;

Expand Down Expand Up @@ -229,19 +226,7 @@ const char kSignalFileCrash[] = "CrashingChildProcess.die";

MULTIPROCESS_TEST_MAIN(CrashingChildProcess) {
WaitToDie(ProcessUtilTest::GetSignalFilePath(kSignalFileCrash).c_str());
#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.
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)
#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.
::signal(SIGSEGV, SIG_DFL);
Expand Down

0 comments on commit 9c811fb

Please sign in to comment.