Commit facab141 authored by jamescook's avatar jamescook Committed by Commit bot

zygote: Don't CHECK if browser gone during zygote startup

When the zygote starts it sends a "boot message" to the browser process
across a socket. If the browser has already exited or crashed the
sendmsg() will fail. We've seen this happen in the Chrome OS autotest
lab.

Instead of crashing the zygote, just log an error and cleanly exit.

BUG=692227
TEST=add sleep to zygote startup, kill browser before zygote boot
message is sent, verify zygote shuts down cleanly

Review-Url: https://codereview.chromium.org/2851473005
Cr-Commit-Position: refs/heads/master@{#468027}
parent 91d96fbd
...@@ -617,10 +617,15 @@ bool ZygoteMain( ...@@ -617,10 +617,15 @@ bool ZygoteMain(
if (using_layer1_sandbox) { if (using_layer1_sandbox) {
// Let the ZygoteHost know we're booting up. // Let the ZygoteHost know we're booting up.
CHECK(base::UnixDomainSocket::SendMsg(kZygoteSocketPairFd, if (!base::UnixDomainSocket::SendMsg(
kZygoteBootMessage, kZygoteSocketPairFd, kZygoteBootMessage, sizeof(kZygoteBootMessage),
sizeof(kZygoteBootMessage), std::vector<int>())) {
std::vector<int>())); // This is not a CHECK failure because the browser process could either
// crash or quickly exit while the zygote is starting. In either case a
// zygote crash is not useful. http://crbug.com/692227
PLOG(ERROR) << "Failed sending zygote boot message";
_exit(1);
}
} }
VLOG(1) << "ZygoteMain: initializing " << fork_delegates.size() VLOG(1) << "ZygoteMain: initializing " << fork_delegates.size()
......
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