Bug 208945 - [macOS] Crash under WebKit::WebProcessPool::platformInitialize()
Summary: [macOS] Crash under WebKit::WebProcessPool::platformInitialize()
Status: RESOLVED FIXED
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: 2020-03-11 14:05 PDT by Per Arne Vollan
Modified: 2020-03-11 15:19 PDT (History)
7 users (show)

See Also:


Attachments
Patch (4.27 KB, patch)
2020-03-11 14:12 PDT, Per Arne Vollan
bfulgham: review+
Details | Formatted Diff | Diff
Patch (2.48 KB, patch)
2020-03-11 14:56 PDT, Per Arne Vollan
thorton: review+
Details | Formatted Diff | Diff
Patch (1.64 KB, patch)
2020-03-11 15:17 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 2020-03-11 14:05:59 PDT
Fix null pointer crash on macOS under WebKit::WebProcessPool::platformInitialize().
Comment 1 Per Arne Vollan 2020-03-11 14:06:14 PDT
rdar://problem/60330751
Comment 2 Per Arne Vollan 2020-03-11 14:12:13 PDT
Created attachment 393287 [details]
Patch
Comment 3 Brent Fulgham 2020-03-11 14:19:36 PDT
Comment on attachment 393287 [details]
Patch

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

r=me

> Source/WTF/wtf/cocoa/SoftLinking.h:53
> +}

I am shocked this doesn't already exist -- but it doesn't!

> Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:702
> +        [[NSNotificationCenter defaultCenter] removeObserver:m_accessibilityEnabledObserver.get()];

Isn't it okay to remove nil objects? I can't remember (though of course, some containers blow up if you use nil things so maybe this is one of those cases).
Comment 4 Per Arne Vollan 2020-03-11 14:25:58 PDT
Committed r258284: <https://trac.webkit.org/changeset/258284/webkit>
Comment 5 Per Arne Vollan 2020-03-11 14:31:25 PDT
(In reply to Brent Fulgham from comment #3)
> Comment on attachment 393287 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=393287&action=review
> 
> r=me
> 
> > Source/WTF/wtf/cocoa/SoftLinking.h:53
> > +}
> 
> I am shocked this doesn't already exist -- but it doesn't!
> 
> > Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:702
> > +        [[NSNotificationCenter defaultCenter] removeObserver:m_accessibilityEnabledObserver.get()];
> 
> Isn't it okay to remove nil objects? I can't remember (though of course,
> some containers blow up if you use nil things so maybe this is one of those
> cases).

I believe the null check is needed.

Thanks for reviewing!
Comment 6 Per Arne Vollan 2020-03-11 14:56:02 PDT
Reopening to attach new patch.
Comment 7 Per Arne Vollan 2020-03-11 14:56:03 PDT
Created attachment 393291 [details]
Patch
Comment 8 Brent Fulgham 2020-03-11 14:58:47 PDT
Comment on attachment 393291 [details]
Patch

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

Looks like Tim already got it, but r=me, too!

> Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:458
> +    if (libAccessibilityLibrary() && _AXSApplicationAccessibilityEnabled()) {

Oops!
Comment 9 Per Arne Vollan 2020-03-11 15:17:34 PDT
Created attachment 393292 [details]
Patch
Comment 10 Per Arne Vollan 2020-03-11 15:19:06 PDT
Committed unreviewed build fix: <https://trac.webkit.org/changeset/258289/webkit>