Commit 4a22c16a authored by hidehiko@chromium.org's avatar hidehiko@chromium.org

Always ignore SIGPIPE for NaCl both in SFI mode and non SFI mode.

Currently, if there is an access to the pipe, whose other side is
already closed, SIGPIPE will be raised in some platform such as linux.
It is unexpected behavior, and causes some test failure.
This is what trusted plugin does in content/app/content_main_runner.cc.

TEST=Ran PPAPINaClPNaClNonSfiTest.Audio locally many times and the flakiness
was gone. Also run trybots.
BUG=371662

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271000 0039d316-1c4b-4281-b951-d872f2087c98
parent c90a5ea7
...@@ -91,6 +91,11 @@ void BecomeNaClLoader(base::ScopedFD browser_fd, ...@@ -91,6 +91,11 @@ void BecomeNaClLoader(base::ScopedFD browser_fd,
nacl::nonsfi::InitializeSignalHandler(); nacl::nonsfi::InitializeSignalHandler();
} }
// Always ignore SIGPIPE, for consistency with other Chrome processes and
// because some IPC code, such as sync_socket_posix.cc, requires this.
// We do this before seccomp-bpf is initialized.
PCHECK(signal(SIGPIPE, SIG_IGN) != SIG_ERR);
// Finish layer-1 sandbox initialization and initialize the layer-2 sandbox. // Finish layer-1 sandbox initialization and initialize the layer-2 sandbox.
CHECK(!nacl_sandbox->HasOpenDirectory()); CHECK(!nacl_sandbox->HasOpenDirectory());
nacl_sandbox->InitializeLayerTwoSandbox(uses_nonsfi_mode); nacl_sandbox->InitializeLayerTwoSandbox(uses_nonsfi_mode);
......
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