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

Issue 1278333003: Fix crash caused by concurrent access to framebuffer_combo_complete_map_. (Closed)

Created:
5 years, 4 months ago by Tobias Sargeant
Modified:
5 years, 4 months ago
CC:
chromium-reviews, piman+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix crash caused by concurrent access to framebuffer_combo_complete_map_. The current implementation of framebuffer completeness testing uses a single global hash_map as a cache. This leads to races in WebView when GPU and render threads try to access the cache concurrently. BUG=518858 Committed: https://crrev.com/fc199b47cb5b74c9f2ccf3a6316fc9b7009c6904 Cr-Commit-Position: refs/heads/master@{#344940}

Patch Set 1 #

Patch Set 2 : Use thread local storage for cache; avoid testing implementation details. #

Patch Set 3 : rebase #

Patch Set 4 : asan errors in tests #

Patch Set 5 : move cache to FramebufferManager. #

Patch Set 6 : Move framebuffer completeness cache to GpuChannelManager, and plumb through. #

Patch Set 7 : fixes #

Total comments: 12

Patch Set 8 : Address comments; return unittesting of cache behaviour. #

Total comments: 17

Patch Set 9 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+209 lines, -141 lines) Patch
M android_webview/browser/deferred_gpu_command_service.h View 1 2 3 4 5 6 2 chunks +4 lines, -0 lines 0 comments Download
M android_webview/browser/deferred_gpu_command_service.cc View 1 2 3 4 5 6 7 8 2 chunks +10 lines, -0 lines 0 comments Download
M components/view_manager/gles2/command_buffer_driver.cc View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -2 lines 0 comments Download
M components/view_manager/gles2/command_buffer_local.cc View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -2 lines 0 comments Download
M content/common/gpu/gpu_channel_manager.h View 1 2 3 4 5 3 chunks +4 lines, -0 lines 0 comments Download
M content/common/gpu/gpu_channel_manager.cc View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
M content/common/gpu/gpu_command_buffer_stub.cc View 1 2 3 4 5 1 chunk +3 lines, -5 lines 0 comments Download
M gpu/command_buffer/service/BUILD.gn View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M gpu/command_buffer/service/context_group.h View 1 2 3 4 5 4 chunks +8 lines, -0 lines 0 comments Download
M gpu/command_buffer/service/context_group.cc View 1 2 3 4 5 6 7 8 3 chunks +16 lines, -2 lines 0 comments Download
M gpu/command_buffer/service/context_group_unittest.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
A gpu/command_buffer/service/framebuffer_completeness_cache.h View 1 2 3 4 5 6 7 8 1 chunk +42 lines, -0 lines 0 comments Download
A gpu/command_buffer/service/framebuffer_completeness_cache.cc View 1 2 3 4 5 6 7 1 chunk +24 lines, -0 lines 0 comments Download
M gpu/command_buffer/service/framebuffer_manager.h View 1 2 3 4 5 8 6 chunks +12 lines, -14 lines 0 comments Download
M gpu/command_buffer/service/framebuffer_manager.cc View 1 2 3 4 5 6 7 8 5 chunks +32 lines, -53 lines 0 comments Download
M gpu/command_buffer/service/framebuffer_manager_unittest.cc View 1 2 3 4 5 6 7 8 8 chunks +5 lines, -32 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc View 1 2 3 4 5 2 chunks +3 lines, -8 lines 0 comments Download
M gpu/command_buffer/service/in_process_command_buffer.h View 1 2 3 4 5 4 chunks +7 lines, -0 lines 0 comments Download
M gpu/command_buffer/service/in_process_command_buffer.cc View 1 2 3 4 5 2 chunks +11 lines, -4 lines 0 comments Download
M gpu/command_buffer/service/texture_manager_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -2 lines 0 comments Download
M gpu/command_buffer/tests/gl_manager.cc View 1 2 3 4 5 1 chunk +4 lines, -8 lines 0 comments Download
M gpu/command_buffer_service.gypi View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M gpu/gles2_conform_support/egl/display.cc View 1 2 3 4 5 1 chunk +3 lines, -8 lines 0 comments Download

Messages

Total messages: 37 (8 generated)
Tobias Sargeant
PTAL. Sorry the diff isn't very clean; I wanted to avoid locking twice. I also ...
5 years, 4 months ago (2015-08-10 15:54:08 UTC) #2
no sievers
Since it's an optimization, can we avoid the lock and just create a map per ...
5 years, 4 months ago (2015-08-10 19:59:25 UTC) #3
no sievers
On 2015/08/10 19:59:25, sievers wrote: > Since it's an optimization, can we avoid the lock ...
5 years, 4 months ago (2015-08-10 19:59:37 UTC) #4
Tobias Sargeant
On 2015/08/10 19:59:37, sievers wrote: > On 2015/08/10 19:59:25, sievers wrote: > > Since it's ...
5 years, 4 months ago (2015-08-10 20:05:11 UTC) #5
Tobias Sargeant
On 2015/08/10 20:05:11, Tobias Sargeant wrote: > On 2015/08/10 19:59:37, sievers wrote: > > On ...
5 years, 4 months ago (2015-08-10 20:12:31 UTC) #6
no sievers
On 2015/08/10 20:12:31, Tobias Sargeant wrote: > On 2015/08/10 20:05:11, Tobias Sargeant wrote: > > ...
5 years, 4 months ago (2015-08-10 21:16:46 UTC) #7
Tobias Sargeant
How's this? Given there's one FramebufferManager per ContextGroup, so it seems like a natural place ...
5 years, 4 months ago (2015-08-14 12:42:47 UTC) #8
no sievers
On 2015/08/14 12:42:47, Tobias Sargeant wrote: > How's this? Given there's one FramebufferManager per ContextGroup, ...
5 years, 4 months ago (2015-08-17 18:00:32 UTC) #9
Tobias Sargeant
On 2015/08/17 18:00:32, sievers wrote: > Technically this regresses it because now all the different ...
5 years, 4 months ago (2015-08-17 18:22:20 UTC) #10
no sievers
On 2015/08/17 18:22:20, Tobias Sargeant wrote: > On 2015/08/17 18:00:32, sievers wrote: > > > ...
5 years, 4 months ago (2015-08-17 19:32:30 UTC) #11
Tobias Sargeant
> You can do the same thing as with the shader translator cache here in ...
5 years, 4 months ago (2015-08-18 15:10:11 UTC) #12
no sievers
This is nice! https://codereview.chromium.org/1278333003/diff/120001/gpu/command_buffer/service/framebuffer_completeness_cache.cc File gpu/command_buffer/service/framebuffer_completeness_cache.cc (right): https://codereview.chromium.org/1278333003/diff/120001/gpu/command_buffer/service/framebuffer_completeness_cache.cc#newcode1 gpu/command_buffer/service/framebuffer_completeness_cache.cc:1: // Copyright (c) 2015 The Chromium ...
5 years, 4 months ago (2015-08-19 00:43:13 UTC) #13
Tobias Sargeant
+boliu for android_webview/ +sky for components/view_manager/gles2/ Daniel: should I add a test that - using ...
5 years, 4 months ago (2015-08-19 11:33:13 UTC) #15
boliu
android_webview lgtm kinda big, guess won't be merged back to m45 then.. https://codereview.chromium.org/1278333003/diff/140001/android_webview/browser/deferred_gpu_command_service.cc File android_webview/browser/deferred_gpu_command_service.cc ...
5 years, 4 months ago (2015-08-19 17:36:19 UTC) #16
Tobias Sargeant
We could merge one of the earlier patchsets, which were a lot smaller... On 19 ...
5 years, 4 months ago (2015-08-19 17:39:38 UTC) #17
no sievers
https://codereview.chromium.org/1278333003/diff/140001/gpu/command_buffer/service/framebuffer_completeness_cache.h File gpu/command_buffer/service/framebuffer_completeness_cache.h (right): https://codereview.chromium.org/1278333003/diff/140001/gpu/command_buffer/service/framebuffer_completeness_cache.h#newcode41 gpu/command_buffer/service/framebuffer_completeness_cache.h:41: #endif // GPU_COMMAND_BUFFER_COMMON_FRAMEBUFFER_COMPLETENESS_CACHE_H_ nit: _COMMON_ -> _SERVICE_ https://codereview.chromium.org/1278333003/diff/140001/gpu/command_buffer/service/framebuffer_manager.cc File ...
5 years, 4 months ago (2015-08-19 23:39:47 UTC) #18
no sievers
https://codereview.chromium.org/1278333003/diff/140001/gpu/command_buffer/service/framebuffer_manager.cc File gpu/command_buffer/service/framebuffer_manager.cc (right): https://codereview.chromium.org/1278333003/diff/140001/gpu/command_buffer/service/framebuffer_manager.cc#newcode262 gpu/command_buffer/service/framebuffer_manager.cc:262: framebuffer_combo_complete_cache_ = NULL; On 2015/08/19 23:39:47, sievers wrote: > ...
5 years, 4 months ago (2015-08-19 23:47:00 UTC) #20
Ken Russell (switch to Gerrit)
Generally looks fine if this has been tested, but a couple of minor points. https://codereview.chromium.org/1278333003/diff/140001/android_webview/browser/deferred_gpu_command_service.h ...
5 years, 4 months ago (2015-08-20 00:04:10 UTC) #21
no sievers
https://codereview.chromium.org/1278333003/diff/140001/gpu/command_buffer/service/framebuffer_manager_unittest.cc File gpu/command_buffer/service/framebuffer_manager_unittest.cc (left): https://codereview.chromium.org/1278333003/diff/140001/gpu/command_buffer/service/framebuffer_manager_unittest.cc#oldcode839 gpu/command_buffer/service/framebuffer_manager_unittest.cc:839: EXPECT_CALL(*gl_, CheckFramebufferStatusEXT(GL_FRAMEBUFFER)) On 2015/08/20 00:04:10, Ken Russell wrote: > ...
5 years, 4 months ago (2015-08-20 00:11:29 UTC) #22
Tobias Sargeant
https://codereview.chromium.org/1278333003/diff/140001/android_webview/browser/deferred_gpu_command_service.cc File android_webview/browser/deferred_gpu_command_service.cc (right): https://codereview.chromium.org/1278333003/diff/140001/android_webview/browser/deferred_gpu_command_service.cc#newcode159 android_webview/browser/deferred_gpu_command_service.cc:159: if (!framebuffer_completeness_cache_.get()) On 2015/08/19 17:36:19, boliu wrote: > style: ...
5 years, 4 months ago (2015-08-20 11:05:14 UTC) #23
no sievers
lgtm
5 years, 4 months ago (2015-08-20 21:05:31 UTC) #24
boliu
Think this is ready to land, right?
5 years, 4 months ago (2015-08-21 23:51:32 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1278333003/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1278333003/160001
5 years, 4 months ago (2015-08-21 23:52:35 UTC) #28
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/91607)
5 years, 4 months ago (2015-08-22 00:04:03 UTC) #30
boliu
+msw for components/view_manager
5 years, 4 months ago (2015-08-22 00:06:10 UTC) #32
msw
On 2015/08/22 00:06:10, boliu wrote: > +msw for components/view_manager components/view_manager rubber stamp lgtm
5 years, 4 months ago (2015-08-22 00:20:40 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1278333003/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1278333003/160001
5 years, 4 months ago (2015-08-22 00:23:14 UTC) #35
commit-bot: I haz the power
Committed patchset #9 (id:160001)
5 years, 4 months ago (2015-08-22 00:39:13 UTC) #36
commit-bot: I haz the power
5 years, 4 months ago (2015-08-22 00:40:18 UTC) #37
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/fc199b47cb5b74c9f2ccf3a6316fc9b7009c6904
Cr-Commit-Position: refs/heads/master@{#344940}

Powered by Google App Engine
This is Rietveld 408576698