Bug 210213

Summary: Release WebGLLayer earlier in ~GraphicsContextGLOpenGL
Product: WebKit Reporter: Kenneth Russell <kbr>
Component: WebGLAssignee: Kenneth Russell <kbr>
Status: RESOLVED WONTFIX    
Severity: Normal CC: dino, ews-watchlist, graouts, justin_fan, kondapallykalyan, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 210151    
Bug Blocks: 210153, 210222    
Attachments:
Description Flags
Patch none

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.