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

Issue 269543014: Use RecvMsgWithPid to find real PID for zygote children (Closed)

Created:
6 years, 7 months ago by mdempsky
Modified:
6 years, 7 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam
Visibility:
Public.

Description

Use RecvMsgWithPid to find real PID for zygote children The new PID discovery protocol now works as follows: 1. The ZygoteHost allocates a UNIX socket pair and includes one end with its fork request to the zygote process. 2. After forking, the zygote child process sends a message over the UNIX socket pair. 3. The ZygoteHost receives the message and a PID for the sender (i.e., child), and writes the PID back over the control socket to the zygote. If the zygote fails to fork a child, its end of the socket pair will be closed, and the ZygoteHost will receive EOF instead of a message. 4. In the non-NaCl case, the zygote writes the child's PID over a pipe for the child to receive. (In the NaCl case, this pipe is no longer used and no PID value is sent to the NaCl child process.) 5. Finally, the zygote sends its normal pickled response back to the ZygoteHost. Two manual tests to make sure this works: 1. Make sure that the "End Process" button in the "Task Manager" dialog still terminates renderer and NaCl processes correctly under Linux. 2. Make sure that Linux Chrome release builds gracefully fail (i.e., don't crash) when nacl_helper is missing at chrome startup and the user navigates to a page that uses NaCl; e.g., http://gonativeclient.appspot.com/demo/ and click "Game of Life". BUG=357670 TEST=manual: see above NOTRY=true Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=269011

Patch Set 1 #

Patch Set 2 : Tweak PID discovery to handle crashing child processes #

Total comments: 29

Patch Set 3 : Respond to jln feedback #

Total comments: 14

Patch Set 4 : Respond to more jln feedback #

Patch Set 5 : LOG(FATAL) if we don't receive a child ping #

Total comments: 4

Patch Set 6 : More jln feedback #

Patch Set 7 : Fix compile error #

Total comments: 6

Patch Set 8 : Restore error handling code paths #

Unified diffs Side-by-side diffs Delta from patch set Stats (+210 lines, -143 lines) Patch
M components/nacl/loader/nacl_helper_linux.cc View 1 2 3 4 5 6 2 chunks +14 lines, -30 lines 0 comments Download
M content/browser/zygote_host/zygote_host_impl_linux.cc View 1 2 3 4 5 6 7 3 chunks +49 lines, -6 lines 0 comments Download
M content/common/child_process_sandbox_support_impl_linux.cc View 1 2 2 chunks +8 lines, -0 lines 0 comments Download
M content/common/zygote_commands_linux.h View 1 2 3 4 5 6 7 2 chunks +9 lines, -1 line 0 comments Download
M content/public/common/child_process_sandbox_support_linux.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M content/public/common/zygote_fork_delegate_linux.h View 1 chunk +5 lines, -5 lines 0 comments Download
M content/zygote/zygote_linux.h View 1 2 3 1 chunk +7 lines, -3 lines 0 comments Download
M content/zygote/zygote_linux.cc View 1 2 3 4 5 6 7 7 chunks +114 lines, -98 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
mdempsky
This is still a work in progress, but tests are already green, so I thought ...
6 years, 7 months ago (2014-05-02 06:12:52 UTC) #1
jln (very slow on Chromium)
- This looks pretty good, but I'm a little worried that it's hard to assess ...
6 years, 7 months ago (2014-05-02 18:25:00 UTC) #2
mdempsky
Thanks for the feedback! I've responded to a couple of your questions, and I'll work ...
6 years, 7 months ago (2014-05-02 20:23:09 UTC) #3
mdempsky
https://codereview.chromium.org/269543014/diff/20001/components/nacl/loader/nacl_helper_linux.cc File components/nacl/loader/nacl_helper_linux.cc (right): https://codereview.chromium.org/269543014/diff/20001/components/nacl/loader/nacl_helper_linux.cc#newcode120 components/nacl/loader/nacl_helper_linux.cc:120: "x", On 2014/05/02 18:25:00, jln wrote: > Let's make ...
6 years, 7 months ago (2014-05-02 23:36:00 UTC) #4
jln (very slow on Chromium)
This looks good in general, but I think we may want more assertions and less ...
6 years, 7 months ago (2014-05-05 19:01:42 UTC) #5
mdempsky
https://codereview.chromium.org/269543014/diff/40001/content/browser/zygote_host/zygote_host_impl_linux.cc File content/browser/zygote_host/zygote_host_impl_linux.cc (right): https://codereview.chromium.org/269543014/diff/40001/content/browser/zygote_host/zygote_host_impl_linux.cc#newcode310 content/browser/zygote_host/zygote_host_impl_linux.cc:310: pickle.WriteInt(1 + mapping.size()); On 2014/05/05 19:01:42, jln wrote: > ...
6 years, 7 months ago (2014-05-05 21:38:17 UTC) #6
jln (very slow on Chromium)
lgtm https://chromiumcodereview.appspot.com/269543014/diff/80001/components/nacl/loader/nacl_helper_linux.cc File components/nacl/loader/nacl_helper_linux.cc (right): https://chromiumcodereview.appspot.com/269543014/diff/80001/components/nacl/loader/nacl_helper_linux.cc#newcode118 components/nacl/loader/nacl_helper_linux.cc:118: // Ping the PID oracle socket. Feel free ...
6 years, 7 months ago (2014-05-05 23:09:32 UTC) #7
mdempsky
https://chromiumcodereview.appspot.com/269543014/diff/80001/components/nacl/loader/nacl_helper_linux.cc File components/nacl/loader/nacl_helper_linux.cc (right): https://chromiumcodereview.appspot.com/269543014/diff/80001/components/nacl/loader/nacl_helper_linux.cc#newcode118 components/nacl/loader/nacl_helper_linux.cc:118: // Ping the PID oracle socket. On 2014/05/05 23:09:33, ...
6 years, 7 months ago (2014-05-05 23:16:24 UTC) #8
mdempsky
piman: Please review tiny changes to content/public for OWNERS approval. Thanks!
6 years, 7 months ago (2014-05-05 23:17:50 UTC) #9
piman
lgtm
6 years, 7 months ago (2014-05-06 00:11:45 UTC) #10
jln (very slow on Chromium)
Mark, could you please take a look for OWNER approval of the small change in ...
6 years, 7 months ago (2014-05-06 01:19:59 UTC) #11
Mark Seaborn
I do have a concern about the robustness of trusting the child process to be ...
6 years, 7 months ago (2014-05-06 23:34:12 UTC) #12
mdempsky
> How is this code path tested these days? Are there any automated test cases ...
6 years, 7 months ago (2014-05-06 23:56:37 UTC) #13
jln (very slow on Chromium)
On 2014/05/06 23:56:37, mdempsky wrote: > Earlier patch sets, I had more fallback cases, but ...
6 years, 7 months ago (2014-05-07 00:52:00 UTC) #14
mdempsky
I've restored the error handling paths that I originally had, so failing to fork a ...
6 years, 7 months ago (2014-05-07 05:39:25 UTC) #15
Mark Seaborn
On 6 May 2014 17:52, <jln@chromium.org> wrote: > On 2014/05/06 23:56:37, mdempsky wrote: > >> ...
6 years, 7 months ago (2014-05-07 15:59:52 UTC) #16
Mark Seaborn
LGTM
6 years, 7 months ago (2014-05-07 16:42:21 UTC) #17
mdempsky
On 2014/05/07 05:39:25, mdempsky wrote: > I'll verify tomorrow that it > fails gracefully when ...
6 years, 7 months ago (2014-05-07 19:06:36 UTC) #18
mdempsky
The CQ bit was checked by mdempsky@chromium.org
6 years, 7 months ago (2014-05-07 19:11:02 UTC) #19
mdempsky
On 2014/05/06 23:34:12, Mark Seaborn wrote: > IIRC, it used to be that this was ...
6 years, 7 months ago (2014-05-07 19:11:58 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mdempsky@chromium.org/269543014/140001
6 years, 7 months ago (2014-05-07 19:16:57 UTC) #21
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-08 01:13:47 UTC) #22
jln (very slow on Chromium)
CQ is drunk. All bots that matters are green. Added NOTRY=true
6 years, 7 months ago (2014-05-08 01:19:07 UTC) #23
jln (very slow on Chromium)
The CQ bit was unchecked by jln@chromium.org
6 years, 7 months ago (2014-05-08 01:19:35 UTC) #24
jln (very slow on Chromium)
The CQ bit was checked by jln@chromium.org
6 years, 7 months ago (2014-05-08 01:19:42 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mdempsky@chromium.org/269543014/140001
6 years, 7 months ago (2014-05-08 01:22:35 UTC) #26
commit-bot: I haz the power
6 years, 7 months ago (2014-05-08 01:26:30 UTC) #27
Message was sent while issue was closed.
Change committed as 269011

Powered by Google App Engine
This is Rietveld 408576698