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

Issue 2741343003: Update liftetime management of GpuClient (Closed)

Created:
3 years, 9 months ago by jonross
Modified:
3 years, 9 months ago
Reviewers:
sadrul, sky
CC:
chromium-reviews, piman
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

While testing expanded mash_browser_tests a flaky shutdown crash was found in GpuClient. GpuClient::EstablishGpuChannel could be called after GpuHost or GpuClient had been deleted. GpuClient was holding a raw pointer back to GpuHost. It's lifetime can exceed GpuHost as it exists in a StrongBindingPtr. It also was registering a callback with and Unretained pointer to itself. So it could be called post delete. This change updates GpuHost to hold all GpuClients in a StrongBindingSet which deletes them upon shutdown. This also updates GpuClient to register the callback with a WeakPtr to itself, so that the callback can be invalidated upon deletion. TEST=GpuHostTest.GpuClientDestructionOrder, GpuHostTest.HostDeletionInvalidatesGpuClientCallback TEST=BrowserTests BUG=701380 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Review-Url: https://codereview.chromium.org/2741343003 Cr-Commit-Position: refs/heads/master@{#459248} Committed: https://chromium.googlesource.com/chromium/src/+/cead65052697a1c3ec0d2fbfb7ee0ee9a9e52963

Patch Set 1 #

Patch Set 2 : moarvim testing/buildbot/filters/mash.browser_tests.filter vim testing/buildbot/filters/mash.browse… #

Patch Set 3 : potential arc crash #

Patch Set 4 : more tests #

Patch Set 5 : testing if https test breaks suite #

Patch Set 6 : remove suspected failure #

Patch Set 7 : remove another potentially crashing test #

Patch Set 8 : try again #

Patch Set 9 : \ #

Patch Set 10 : also works? #

Patch Set 11 : logs for trybots #

Patch Set 12 : Testing GpuClient #

Total comments: 2

Patch Set 13 : Redo GpuClient handling #

Patch Set 14 : Rebase #

Patch Set 15 : missing deps: #

Total comments: 19

Patch Set 16 : Address Review comments #

Total comments: 2

Patch Set 17 : Update Deps. Remove Test Filter #

Total comments: 2

Patch Set 18 : Remove gpu/ipc/service deps #

Patch Set 19 : fix x11 re-definition #

Unified diffs Side-by-side diffs Delta from patch set Stats (+286 lines, -70 lines) Patch
M services/ui/ws/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +4 lines, -0 lines 0 comments Download
M services/ui/ws/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +3 lines, -0 lines 0 comments Download
A services/ui/ws/gpu_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +69 lines, -0 lines 0 comments Download
A services/ui/ws/gpu_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +67 lines, -0 lines 0 comments Download
M services/ui/ws/gpu_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +12 lines, -0 lines 0 comments Download
M services/ui/ws/gpu_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +11 lines, -70 lines 0 comments Download
A services/ui/ws/gpu_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +120 lines, -0 lines 0 comments Download

Messages

Total messages: 38 (17 generated)
jonross
Hey Sadrul, This change includes some testing work on GpuClient, where deleting the GpuHost invalidates ...
3 years, 9 months ago (2017-03-20 22:08:35 UTC) #3
jonross
https://codereview.chromium.org/2741343003/diff/220001/services/ui/ws/gpu_host_unittest.cc File services/ui/ws/gpu_host_unittest.cc (right): https://codereview.chromium.org/2741343003/diff/220001/services/ui/ws/gpu_host_unittest.cc#newcode72 services/ui/ws/gpu_host_unittest.cc:72: // host_deletion_callback_.Run(); With this turned on the callback doesn't ...
3 years, 9 months ago (2017-03-20 22:09:02 UTC) #4
sadrul
https://codereview.chromium.org/2741343003/diff/220001/services/ui/ws/gpu_host_unittest.cc File services/ui/ws/gpu_host_unittest.cc (right): https://codereview.chromium.org/2741343003/diff/220001/services/ui/ws/gpu_host_unittest.cc#newcode110 services/ui/ws/gpu_host_unittest.cc:110: : task_runner_(new base::TestSimpleTaskRunner), Don't you need to actually install ...
3 years, 9 months ago (2017-03-20 22:28:22 UTC) #5
jonross
On 2017/03/20 22:28:22, sadrul wrote: > https://codereview.chromium.org/2741343003/diff/220001/services/ui/ws/gpu_host_unittest.cc > File services/ui/ws/gpu_host_unittest.cc (right): > > https://codereview.chromium.org/2741343003/diff/220001/services/ui/ws/gpu_host_unittest.cc#newcode110 > ...
3 years, 9 months ago (2017-03-22 02:15:29 UTC) #7
sadrul
https://codereview.chromium.org/2741343003/diff/280001/services/ui/ws/gpu_host.cc File services/ui/ws/gpu_host.cc (right): https://codereview.chromium.org/2741343003/diff/280001/services/ui/ws/gpu_host.cc#newcode134 services/ui/ws/gpu_host.cc:134: std::unique_ptr<GpuClient> client(base::MakeUnique<GpuClient>( auto client = base::MakeUnique<... https://codereview.chromium.org/2741343003/diff/280001/services/ui/ws/gpu_host.h File services/ui/ws/gpu_host.h ...
3 years, 9 months ago (2017-03-22 16:41:13 UTC) #8
sadrul
https://codereview.chromium.org/2741343003/diff/280001/services/ui/ws/gpu_host_unittest.cc File services/ui/ws/gpu_host_unittest.cc (right): https://codereview.chromium.org/2741343003/diff/280001/services/ui/ws/gpu_host_unittest.cc#newcode131 services/ui/ws/gpu_host_unittest.cc:131: : task_runner_(new base::TestSimpleTaskRunner), gpu_service_(task_runner_) { Is there a reason ...
3 years, 9 months ago (2017-03-22 16:42:04 UTC) #9
jonross
https://codereview.chromium.org/2741343003/diff/280001/services/ui/ws/gpu_host_unittest.cc File services/ui/ws/gpu_host_unittest.cc (right): https://codereview.chromium.org/2741343003/diff/280001/services/ui/ws/gpu_host_unittest.cc#newcode150 services/ui/ws/gpu_host_unittest.cc:150: EXPECT_EQ(nullptr, client_ref_); On 2017/03/22 16:41:13, sadrul wrote: > This ...
3 years, 9 months ago (2017-03-22 16:49:43 UTC) #10
jonross
https://codereview.chromium.org/2741343003/diff/280001/services/ui/ws/gpu_host.cc File services/ui/ws/gpu_host.cc (right): https://codereview.chromium.org/2741343003/diff/280001/services/ui/ws/gpu_host.cc#newcode134 services/ui/ws/gpu_host.cc:134: std::unique_ptr<GpuClient> client(base::MakeUnique<GpuClient>( On 2017/03/22 16:41:13, sadrul wrote: > auto ...
3 years, 9 months ago (2017-03-23 00:38:30 UTC) #11
sadrul
Cool! lgtm https://codereview.chromium.org/2741343003/diff/300001/services/ui/ws/DEPS File services/ui/ws/DEPS (right): https://codereview.chromium.org/2741343003/diff/300001/services/ui/ws/DEPS#newcode7 services/ui/ws/DEPS:7: "+services/ui/gpu", Hrm. I guess these are for ...
3 years, 9 months ago (2017-03-23 15:26:57 UTC) #12
jonross
https://codereview.chromium.org/2741343003/diff/300001/services/ui/ws/DEPS File services/ui/ws/DEPS (right): https://codereview.chromium.org/2741343003/diff/300001/services/ui/ws/DEPS#newcode7 services/ui/ws/DEPS:7: "+services/ui/gpu", On 2017/03/23 15:26:56, sadrul wrote: > Hrm. I ...
3 years, 9 months ago (2017-03-23 16:41:39 UTC) #14
jonross
sky@chromium.org: Please review changes in services/ui/ws/BUILD and DEPS? Thanks, Jon
3 years, 9 months ago (2017-03-23 16:42:16 UTC) #16
sky
LGTM
3 years, 9 months ago (2017-03-23 18:45:59 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2741343003/340001
3 years, 9 months ago (2017-03-23 18:51:51 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/393147)
3 years, 9 months ago (2017-03-23 19:01:37 UTC) #22
jonross
Hi piman@, As an owner of /gpu/ipc/service, could you review this new DEPS? It is ...
3 years, 9 months ago (2017-03-23 19:59:28 UTC) #24
sadrul
https://codereview.chromium.org/2741343003/diff/340001/services/ui/ws/gpu_host_unittest.cc File services/ui/ws/gpu_host_unittest.cc (right): https://codereview.chromium.org/2741343003/diff/340001/services/ui/ws/gpu_host_unittest.cc#newcode50 services/ui/ws/gpu_host_unittest.cc:50: gpu::GpuWatchdogThread::Create(), Just use nullptr here?
3 years, 9 months ago (2017-03-23 20:00:20 UTC) #25
jonross
Hi piman@, My mistake, sadrul@ noticed that the new DEPS I was adding was actually ...
3 years, 9 months ago (2017-03-23 20:09:50 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2741343003/360001
3 years, 9 months ago (2017-03-23 20:10:51 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/390083) linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, ...
3 years, 9 months ago (2017-03-23 20:33:21 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2741343003/380001
3 years, 9 months ago (2017-03-23 20:57:58 UTC) #35
commit-bot: I haz the power
3 years, 9 months ago (2017-03-23 22:13:49 UTC) #38
Message was sent while issue was closed.
Committed patchset #19 (id:380001) as
https://chromium.googlesource.com/chromium/src/+/cead65052697a1c3ec0d2fbfb7ee...

Powered by Google App Engine
This is Rietveld 408576698