Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1891)

Unified Diff: content/zygote/zygote_main_linux.cc

Issue 2851473005: zygote: Don't CHECK if browser gone during zygote startup (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/sandbox_linux/sandbox_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/zygote/zygote_main_linux.cc
diff --git a/content/zygote/zygote_main_linux.cc b/content/zygote/zygote_main_linux.cc
index b6f7089e35cdfe1d46c9a010e7e9b8b90cc0351a..733d6df231f4a98cb4b49ebe1b99e26f4db26d40 100644
--- a/content/zygote/zygote_main_linux.cc
+++ b/content/zygote/zygote_main_linux.cc
@@ -617,10 +617,16 @@ bool ZygoteMain(
if (using_layer1_sandbox) {
// Let the ZygoteHost know we're booting up.
- CHECK(base::UnixDomainSocket::SendMsg(kZygoteSocketPairFd,
- kZygoteBootMessage,
- sizeof(kZygoteBootMessage),
- std::vector<int>()));
+ if (!base::UnixDomainSocket::SendMsg(
+ kZygoteSocketPairFd, kZygoteBootMessage, sizeof(kZygoteBootMessage),
+ 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";
+ linux_sandbox->set_exiting_before_initialize_sandbox(true);
James Cook 2017/04/27 22:30:23 If I don't do something like this I hit the CHECK(
mdempsky 2017/04/27 22:50:45 Since this is security sensitive code, I'd prefer
James Cook 2017/04/28 02:39:48 Sounds good. Done.
+ return false;
+ }
}
VLOG(1) << "ZygoteMain: initializing " << fork_delegates.size()
« no previous file with comments | « content/common/sandbox_linux/sandbox_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698