CreateCoordinationUnit has bad DCHECK |
|||||||
Issue descriptionSee log here: https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Ftryserver.chromium.win%2Fwin_chromium_rel_ng%2F515299%2F%2B%2Frecipes%2Fsteps%2Fsync_integration_tests__with_patch_%2F0%2Flogs%2FSingleClientAppsSyncTest.InstallSomeApps%2F0 Looks like we're adding duplicate entries into g_cu_map.
,
Aug 18 2017
+lpy@ and fmeawad@
,
Aug 18 2017
It looks like we create duplicate ProcessCUs.
,
Aug 18 2017
ducbui: I'm guessing https://chromium-review.googlesource.com/c/585906 ? It might be creating a new CU rather than duplicating a messagepipe to an existing one.
,
Aug 18 2017
Sorry, I mean https://chromium-review.googlesource.com/613820
,
Aug 18 2017
the last reland is https://chromium-review.googlesource.com/c/617982 That may cause by multi-processes? We created it in browser process but hook it up in render process when we initialize blink platform.
,
Aug 18 2017
The DCHECK() failed because GRC tries to create new coordination unit with duplicated ID: id.id = 0 and id.type = kProcess. The reason is base::ProcessHandle RenderProcessHostImpl::GetHandle() return 0 (kNullProcessHandle) when (!child_process_launcher_.get() || child_process_launcher_->IsStarting()) condition is true. https://cs.chromium.org/chromium/src/content/browser/renderer_host/render_process_host_impl.cc?sq=package:chromium&l=2778 When the DCHECK failed, there were multiple requests from BlinkResourceCoordination while GetHandle() returns the same number 0 instead of unique process handle. I observe this happens only when the machine is overloaded so child_process_launcher_ might take long time to finish.
,
Aug 18 2017
+erikchen@ Hello Erik, I think process id is added by you as cu id in your patch? Do you have any suggestion here?
,
Aug 18 2017
Interesting. The problem is that we make the RPH makes the CU before it has its process ID [which is being overloaded to be the CU id]. I think the easiest solution is to break out a separate field for PID that isn't CU id, and then the RPH can fill in that field when the handle is available.
,
Aug 18 2017
I think we won't be allowed to have pid in GRC, since it will be accessible by render process itself.
,
Aug 18 2017
there's no reason the field needs to be exposed to the renderer. Visiblity seems to be a general issue that GRC needs to work out.
,
Aug 18 2017
Oystein, what do you think if we duplicate some PropertyType to something like SandboxedPropertyType that is accessible without security concern?
,
Aug 19 2017
This prevented a patch I have out from landing: https://chromium-swarm.appspot.com/task?id=3810c40213102410&refresh=10&show_raw=1&wide_logs=true . Can we get this fixed soon? I'm randomly picking Erik as an owner (sorry).
,
Aug 21 2017
over to oysteine, GRC owner.
,
Aug 21 2017
As a workaround, I will return nullptr for GetProcessCU if process id is not valid, and create it later.
,
Aug 21 2017
There's no general accessor functionality for the GRC that renderers can use to arbitrarily pull out data, so the GRC having PIDs is a non-issue. Moving it to a separate property rather than baked into the ID sgtm, though.
,
Aug 22 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/19278fd88ddaf88a73d70acd4ff65392fb3531da commit 19278fd88ddaf88a73d70acd4ff65392fb3531da Author: Peiyong Lin <lpy@chromium.org> Date: Tue Aug 22 18:32:03 2017 [GRC] Add PID as property to ProcessCoordinationUnit. Instead of setting up Process Coordination Unit with a pid, this patch sends a pid when the process is launched. A ProcessCoordinationUnit is issued to be created from the Blink side when Blink is initialized, however, under some conditions, the process is not yet ready, which results in duplication ProcessCoordinationUnit with the same pid because GetHandle returns kNullProcessHandle. BUG= 756891 Change-Id: I3dc79da5a3ad2a23bbec7952607634a272bbdfb7 Reviewed-on: https://chromium-review.googlesource.com/623916 Reviewed-by: Emily Stark <estark@chromium.org> Reviewed-by: John Abd-El-Malek <jam@chromium.org> Reviewed-by: Oystein Eftevaag <oysteine@chromium.org> Commit-Queue: lpy <lpy@chromium.org> Cr-Commit-Position: refs/heads/master@{#496379} [modify] https://crrev.com/19278fd88ddaf88a73d70acd4ff65392fb3531da/content/browser/renderer_host/render_process_host_impl.cc [modify] https://crrev.com/19278fd88ddaf88a73d70acd4ff65392fb3531da/services/resource_coordinator/coordination_unit/coordination_unit_introspector_impl.cc [modify] https://crrev.com/19278fd88ddaf88a73d70acd4ff65392fb3531da/services/resource_coordinator/public/interfaces/signals.mojom
,
Aug 22 2017
Marked as fixed.
,
Aug 22 2017
Thanks team for the quick action here. I appreciate it! |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by csharrison@chromium.org
, Aug 18 2017