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

Issue 558803002: Workaround to prevent crashes when destroying CGL contexts (Closed)

Created:
6 years, 3 months ago by ccameron
Modified:
6 years, 3 months ago
CC:
chromium-reviews, jam, sievers+watch_chromium.org, jbauman+watch_chromium.org, darin-cc_chromium.org, kalyank, piman+watch_chromium.org, danakj+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Workaround to prevent crashes when destroying CGL contexts Observation 1: It was discovered in crbug.com/410402 that deleting the GL textures bound to IOSurfaces before releasing the CGL context from the CAOpenGLLayer can result in crashes. Observation 2: It was discovered in crbug.com/411782 that not deleting the GL textures bounds to IOSurfaces before destroying the CGL context can result in crashes. As way speculative workaround for this, retain the CGL context when the texture is created (when it is known to be valid), and the post a task to - make that CGL context current - delete the GL texture - make no CGL context current - release the CGL context - release the IOSurface used by the GL texture The theory here is that by doing this in a posted task, having a fresh stack and having manually retained the CGL context when it was known-valid will work around the crash in Observation 1, and manually destroying the texture while its IOSurface is still retained and before the CGL context is destroyed will work around the crash in Observation 2. BUG=411782 Committed: https://crrev.com/282049cc52cd09cca07b8bd838f448174c7a87f5 Cr-Commit-Position: refs/heads/master@{#294275}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Plug leaks #

Total comments: 3

Patch Set 3 : use RETAIN #

Unified diffs Side-by-side diffs Delta from patch set Stats (+64 lines, -17 lines) Patch
M content/browser/compositor/io_surface_layer_mac.h View 2 chunks +6 lines, -3 lines 0 comments Download
M content/browser/compositor/io_surface_layer_mac.mm View 1 2 8 chunks +58 lines, -14 lines 0 comments Download

Messages

Total messages: 12 (2 generated)
ccameron
I tested the scenarios that were failing from "Observation 1", but without any repro for ...
6 years, 3 months ago (2014-09-09 21:26:59 UTC) #2
Ken Russell (switch to Gerrit)
https://codereview.chromium.org/558803002/diff/1/content/browser/compositor/io_surface_layer_mac.mm File content/browser/compositor/io_surface_layer_mac.mm (right): https://codereview.chromium.org/558803002/diff/1/content/browser/compositor/io_surface_layer_mac.mm#newcode54 content/browser/compositor/io_surface_layer_mac.mm:54: // Finally release down the IOSurface. "release the IOSurface" ...
6 years, 3 months ago (2014-09-10 01:04:08 UTC) #3
ccameron
No idea what I was thinking with that. I'm re-running the tests with that fixed ...
6 years, 3 months ago (2014-09-10 01:30:03 UTC) #4
Ken Russell (switch to Gerrit)
Have you attached the OpenGL Driver Monitor to the browser process and made sure that ...
6 years, 3 months ago (2014-09-10 04:06:39 UTC) #5
ccameron
Thanks! I gave this a run with the GL driver monitor, and this doesn't have ...
6 years, 3 months ago (2014-09-10 07:53:26 UTC) #6
Ken Russell (switch to Gerrit)
LGTM with one more comment. https://codereview.chromium.org/558803002/diff/20001/content/browser/compositor/io_surface_layer_mac.mm File content/browser/compositor/io_surface_layer_mac.mm (right): https://codereview.chromium.org/558803002/diff/20001/content/browser/compositor/io_surface_layer_mac.mm#newcode356 content/browser/compositor/io_surface_layer_mac.mm:356: io_surface_texture_context_.reset(CGLRetainContext(glContext)); On 2014/09/10 07:53:26, ...
6 years, 3 months ago (2014-09-10 22:24:52 UTC) #7
ccameron
Excellent idea -- thanks, that makes it much more clear.
6 years, 3 months ago (2014-09-10 22:49:14 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/558803002/40001
6 years, 3 months ago (2014-09-10 22:51:17 UTC) #10
commit-bot: I haz the power
Committed patchset #3 (id:40001) as 85cbb6b258c493bd15a9d77bb52bfbfcfa4005c4
6 years, 3 months ago (2014-09-11 00:50:39 UTC) #11
commit-bot: I haz the power
6 years, 3 months ago (2014-09-11 00:53:41 UTC) #12
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/282049cc52cd09cca07b8bd838f448174c7a87f5
Cr-Commit-Position: refs/heads/master@{#294275}

Powered by Google App Engine
This is Rietveld 408576698