Bug 237278

Summary: Remove release assert when UI process is blocking IOSurface IOKit access
Product: WebKit Reporter: Per Arne Vollan <pvollan>
Component: WebKit Misc.Assignee: Per Arne Vollan <pvollan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, darin, ggaren, simon.fraser, slewis, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch none

Description Per Arne Vollan 2022-02-28 10:16:54 PST
Remove release assert in IOSurface::bytesPerRowAlignment() when UI process is blocking IOSurface IOKit access.
Comment 1 Per Arne Vollan 2022-02-28 10:19:18 PST
Created attachment 453405 [details]
Patch
Comment 2 Simon Fraser (smfr) 2022-02-28 11:21:28 PST
Comment on attachment 453405 [details]
Patch

I'm not sure why we'd special-case this one, and not the other places where we make IOKit calls which need to be removed before we can enable blocking?
Comment 3 Per Arne Vollan 2022-02-28 12:53:18 PST
(In reply to Simon Fraser (smfr) from comment #2)
> Comment on attachment 453405 [details]
> Patch
> 
> I'm not sure why we'd special-case this one, and not the other places where
> we make IOKit calls which need to be removed before we can enable blocking?

This IOKit call only takes place in the UI process. We're brokering the value to the WebContent process.

Thanks for reviewing!
Comment 4 Darin Adler 2022-02-28 14:33:10 PST
Comment on attachment 453405 [details]
Patch

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

> Source/WebCore/platform/graphics/cocoa/IOSurface.mm:299
> +            // 64 bytes is currently the alignment on all platforms.
> +            alignment = 64;

Why not just return a constant? We don’t need to call IOSurface just to feel good.
Comment 5 Per Arne Vollan 2022-02-28 14:41:34 PST
(In reply to Darin Adler from comment #4)
> Comment on attachment 453405 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=453405&action=review
> 
> > Source/WebCore/platform/graphics/cocoa/IOSurface.mm:299
> > +            // 64 bytes is currently the alignment on all platforms.
> > +            alignment = 64;
> 
> Why not just return a constant? We don’t need to call IOSurface just to feel
> good.

That is a good point. I kept the IOSurface call in case the constant should change at some point.

Thanks for reviewing!
Comment 6 EWS 2022-02-28 15:27:59 PST
Committed r290618 (247891@main): <https://commits.webkit.org/247891@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 453405 [details].
Comment 7 Radar WebKit Bug Importer 2022-02-28 15:29:15 PST
<rdar://problem/89585043>
Comment 8 Geoffrey Garen 2022-02-28 15:31:27 PST
Comment on attachment 453405 [details]
Patch

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

> Source/WebCore/platform/graphics/cocoa/IOSurface.mm:297
> +            RELEASE_LOG_FAULT(Layers, "Sandbox does not allow IOSurface IOKit access.");

RELEASE_LOG_FAULT produces a CrashTracer report. Does this code path execute frequently? If so, it will become our top CrashTracer report (even if the user does not experience a process termination). Do we have other options for gathering whatever information we're trying to gather here?
Comment 9 Per Arne Vollan 2022-03-01 07:41:26 PST
(In reply to Geoffrey Garen from comment #8)
> Comment on attachment 453405 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=453405&action=review
> 
> > Source/WebCore/platform/graphics/cocoa/IOSurface.mm:297
> > +            RELEASE_LOG_FAULT(Layers, "Sandbox does not allow IOSurface IOKit access.");
> 
> RELEASE_LOG_FAULT produces a CrashTracer report. Does this code path execute
> frequently? If so, it will become our top CrashTracer report (even if the
> user does not experience a process termination). Do we have other options
> for gathering whatever information we're trying to gather here?

That is a very good point. The code path is expected to execute very infrequently, although I still think it makes sense to avoid possible crash reports. I will change this to log an error instead.

Thanks for reviewing!
Comment 10 Per Arne Vollan 2022-03-01 09:23:27 PST
Reopening to attach new patch.
Comment 11 Per Arne Vollan 2022-03-01 09:23:28 PST
Created attachment 453503 [details]
Patch
Comment 12 EWS 2022-03-01 14:07:51 PST
Committed r290675 (247946@main): <https://commits.webkit.org/247946@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 453503 [details].