Bug 200648 - REGRESSION (r248440): MiniBrowser no longer loads file:// URLs on launch
Summary: REGRESSION (r248440): MiniBrowser no longer loads file:// URLs on launch
Status: RESOLVED DUPLICATE of bug 200772
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Per Arne Vollan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-08-12 16:55 PDT by Per Arne Vollan
Modified: 2022-02-10 16:46 PST (History)
8 users (show)

See Also:


Attachments
Patch (3.50 KB, patch)
2019-08-12 17:10 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (3.51 KB, patch)
2019-08-13 07:51 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Per Arne Vollan 2019-08-12 16:55:44 PDT
This is a regression from https://trac.webkit.org/changeset/248440/webkit.
Comment 1 Per Arne Vollan 2019-08-12 16:56:15 PDT
rdar://problem/54168065
Comment 2 Brent Fulgham 2019-08-12 16:57:43 PDT
Is this a race condition where we don't have the PID yet when we try to create the sandbox extension?
Comment 3 Per Arne Vollan 2019-08-12 17:01:14 PDT
(In reply to Brent Fulgham from comment #2)
> Is this a race condition where we don't have the PID yet when we try to
> create the sandbox extension?

I think the pid is valid, but I will double-check.
Comment 4 Per Arne Vollan 2019-08-12 17:10:11 PDT
Created attachment 376109 [details]
Patch
Comment 5 Brent Fulgham 2019-08-12 18:19:36 PDT
Comment on attachment 376109 [details]
Patch

Oh! Got it.
Comment 6 Per Arne Vollan 2019-08-13 07:32:13 PDT
(In reply to Brent Fulgham from comment #2)
> Is this a race condition where we don't have the PID yet when we try to
> create the sandbox extension?

You are right, Brent. There seems to be a race between creating the sandbox extension when starting the load and getting the pid of the new WebContent process.
Comment 7 Per Arne Vollan 2019-08-13 07:51:22 PDT
Created attachment 376162 [details]
Patch
Comment 8 Brent Fulgham 2019-08-13 13:51:15 PDT
Comment on attachment 376162 [details]
Patch

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

> Source/WebKit/Shared/Cocoa/SandboxExtensionCocoa.mm:352
> +        return false;

Do we cleanly recover if this returns false? I.e., if the pid isn't available and so we don't create the extension, does WebKit try again later?
Comment 9 Per Arne Vollan 2019-08-13 14:02:50 PDT
(In reply to Brent Fulgham from comment #8)
> Comment on attachment 376162 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=376162&action=review
> 
> > Source/WebKit/Shared/Cocoa/SandboxExtensionCocoa.mm:352
> > +        return false;
> 
> Do we cleanly recover if this returns false? I.e., if the pid isn't
> available and so we don't create the extension, does WebKit try again later?

If the pid is invalid, the patch falls back to creating an extension without the pid. I am not sure if this is the optimal solution. I am also looking into creating the extension with an audit token instead of a pid.

Thanks for reviewing!
Comment 10 Per Arne Vollan 2019-08-15 11:01:16 PDT

*** This bug has been marked as a duplicate of bug 200772 ***