Bug 210213 - Release WebGLLayer earlier in ~GraphicsContextGLOpenGL
Summary: Release WebGLLayer earlier in ~GraphicsContextGLOpenGL
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kenneth Russell
URL:
Keywords: InRadar
Depends on: 210151
Blocks: 210153 210222
  Show dependency treegraph
 
Reported: 2020-04-08 14:40 PDT by Kenneth Russell
Modified: 2020-04-20 11:21 PDT (History)
6 users (show)

See Also:


Attachments
Patch (3.23 KB, patch)
2020-04-08 14:44 PDT, Kenneth Russell
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Russell 2020-04-08 14:40:44 PDT
In GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL in Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm, the native context is deleted and [WebGLLayer setContext:] called immediately afterward to clear out its NakedPtr<GraphicsContextGLOpenGL>. In order to allow WebGLLayer's cleanup code to potentially do work with the native context, it seems appropriate to release the WebGLLayer earlier.

May be related to other recently filed crashes.
Comment 1 Kenneth Russell 2020-04-08 14:44:06 PDT
Created attachment 395871 [details]
Patch
Comment 2 EWS 2020-04-08 15:57:56 PDT
Committed r259764: <https://trac.webkit.org/changeset/259764>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 395871 [details].
Comment 3 Radar WebKit Bug Importer 2020-04-08 15:58:13 PDT
<rdar://problem/61482594>
Comment 4 Ryan Haddad 2020-04-10 17:41:42 PDT
Reverted r259764 for reason:

Causes layout test crashes under GuardMalloc

Committed r259915: <https://trac.webkit.org/changeset/259915>
Comment 5 Ryan Haddad 2020-04-10 17:44:23 PDT
(In reply to Ryan Haddad from comment #4)
> Reverted r259764 for reason:
> 
> Causes layout test crashes under GuardMalloc
> 
> Committed r259915: <https://trac.webkit.org/changeset/259915>
We were seeing crashes on iOS Simulator when running tests under GuardMalloc

These are some of the tests that hit crashes:
fast/canvas/webgl/no-info-log-for-simple-shaders.html
fast/canvas/webgl/tex-image-and-sub-image-2d-with-image.html
webgl/1.0.3/conformance/extensions/ext-blend-minmax.html
fast/canvas/webgl/no-info-log-for-simple-shaders.html
Comment 6 Kenneth Russell 2020-04-10 18:16:26 PDT
Thanks Ryan and sorry about the crashes. Was worried about that.

How can I run my local iOS Simulator build with GuardMalloc?
Comment 7 Kenneth Russell 2020-04-13 16:11:44 PDT
Note - per fix in Bug 210222, if that one lands and sticks, I'll likely close this as WontFix rather than trying to pursue it further.
Comment 8 Kenneth Russell 2020-04-20 11:21:38 PDT
The fix for Bug 210222 seems that it's stable and won't be reverted, so closing this out as WontFix.