Commit be3d8853 authored by Robert Sesek's avatar Robert Sesek Committed by Commit Bot

Fix sandbox_linux_unittests on recent Android by resetting signal handlers.

SIGSYS is grabbed by the system seccomp filter trap, and SIGSEGV is
grabbed by libsigchain. Both of these need to have their default signal
actions so that the sandbox test framework can interpret process death
accurately.

Cq-Include-Trybots: master.tryserver.chromium.android:android_arm64_dbg_recipe;master.tryserver.chromium.android:android_compile_x64_dbg;master.tryserver.chromium.android:android_compile_x86_dbg
Change-Id: I3879f83bd16d1a71df389fe25d52bb68baacf596
Reviewed-on: https://chromium-review.googlesource.com/984516Reviewed-by: default avatarJorge Lucangeli Obes <jorgelo@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548059}
parent f7bc768e
...@@ -177,6 +177,18 @@ void UnitTests::RunTestInProcess(SandboxTestRunner* test_runner, ...@@ -177,6 +177,18 @@ void UnitTests::RunTestInProcess(SandboxTestRunner* test_runner,
struct rlimit no_core = {0}; struct rlimit no_core = {0};
setrlimit(RLIMIT_CORE, &no_core); setrlimit(RLIMIT_CORE, &no_core);
#if defined(OS_ANDROID)
// On Android Oreo and higher, the system applies a seccomp filter to all
// processes. It has its own SIGSYS handler that is un-hooked here in the
// test child process, so that the Chromium handler can be used. This
// is performed by SeccompStarterAndroid in normal builds.
signal(SIGSYS, SIG_DFL);
// In addition, libsigchain will install a SEGV handler that is normally
// used for JVM fault handling. Reset it so that the test SEGV failures
// are interpreted correctly.
signal(SIGSEGV, SIG_DFL);
#endif
test_runner->Run(); test_runner->Run();
if (test_runner->ShouldCheckForLeaks()) { if (test_runner->ShouldCheckForLeaks()) {
#if defined(LEAK_SANITIZER) #if defined(LEAK_SANITIZER)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment