Bug 228978

Summary: Avoid infinite recursion when command buffer creation fails
Product: WebKit Reporter: Kyle Piddington <kpiddington>
Component: New BugsAssignee: Kyle Piddington <kpiddington>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, ews-watchlist, kbr, kondapallykalyan, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch for landing none

Description Kyle Piddington 2021-08-10 15:37:41 PDT
Avoid infinite recursion when command buffer creation fails
Comment 1 Kyle Piddington 2021-08-10 15:42:47 PDT
Created attachment 435308 [details]
Patch
Comment 2 EWS Watchlist 2021-08-10 15:43:34 PDT
Note that there are important steps to take when updating ANGLE. See https://trac.webkit.org/wiki/UpdatingANGLE
Comment 3 Kyle Piddington 2021-08-10 15:43:49 PDT
Created attachment 435309 [details]
Patch
Comment 4 Kenneth Russell 2021-08-10 16:30:56 PDT
Comment on attachment 435309 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=435309&action=review

Looks good; r+. Minor comment about the ChangeLog.

If there are any cases where this was found in the wild, I'd appreciate it if you could mention them on https://bugs.webkit.org/show_bug.cgi?id=228978 .

> Source/ThirdParty/ANGLE/ChangeLog:9
> +        In cases where the MTLCommandBuffer is not a valid metal object, we can end up in an infinite recursive loop during context steup. Refactor setupDraw to take no more than two attempts through the setup function. 

Could you reflow to 80 columns? This makes it easier to read the ChangeLogs and commit messages later. Also: steup -> setup.
Comment 5 Kyle Piddington 2021-08-11 10:40:19 PDT
We've had a few reports in from the wild, but no luck with a repro case. The best I've got is that we ended up in a state where the metal device was available, but we failed to create a command queue for another process as well.
Comment 6 Kyle Piddington 2021-08-11 12:36:41 PDT
Created attachment 435368 [details]
Patch for landing
Comment 7 EWS 2021-08-11 13:04:43 PDT
Committed r280926 (240444@main): <https://commits.webkit.org/240444@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 435368 [details].
Comment 8 Radar WebKit Bug Importer 2021-08-11 13:05:24 PDT
<rdar://problem/81809463>