Bug 184865 - Web Inspector: WebInspectorProxy releases WKWebInspectorProxyObjCAdapter without removing corresponding observer
Summary: Web Inspector: WebInspectorProxy releases WKWebInspectorProxyObjCAdapter with...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All OS X 10.11
: P1 Critical
Assignee: Matt Baker
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-04-21 13:25 PDT by Matt Baker
Modified: 2018-04-22 16:03 PDT (History)
5 users (show)

See Also:


Attachments
Patch (2.69 KB, patch)
2018-04-21 13:29 PDT, Matt Baker
no flags Details | Formatted Diff | Diff
Patch (1.96 KB, patch)
2018-04-22 12:36 PDT, Matt Baker
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews204 for win-future (12.59 MB, application/zip)
2018-04-22 14:14 PDT, EWS Watchlist
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Baker 2018-04-21 13:25:30 PDT
Summary:
WebInspectorProxy releases WKWebInspectorProxyObjCAdapter without removing corresponding observer.

As an optimization we keep the Inspector WebView alive for a minute after it's been closed, so that it can be reused if reopened quickly. If the Inspector is reopened within this time, WebInspectorProxy::platformCreateFrontendPage() will be called while the WKWebInspectorProxyObjCAdapter still exists. It then gets recreated, causing the original instance to be released while still registered as a a notification observer.

Prior to macOS 10.12, NSNotificationCenter didn't perform any sanity checks on observers before dispatching notifications, resulting in an access violation.
Comment 1 Matt Baker 2018-04-21 13:25:45 PDT
<rdar://problem/37764960>
Comment 2 Matt Baker 2018-04-21 13:29:10 PDT
Created attachment 338536 [details]
Patch
Comment 3 Matt Baker 2018-04-22 12:36:54 PDT
Created attachment 338558 [details]
Patch
Comment 4 EWS Watchlist 2018-04-22 14:14:18 PDT
Comment on attachment 338558 [details]
Patch

Attachment 338558 [details] did not pass win-ews (win):
Output: http://webkit-queues.webkit.org/results/7406043

New failing tests:
http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-audio.html
Comment 5 EWS Watchlist 2018-04-22 14:14:29 PDT
Created attachment 338559 [details]
Archive of layout-test-results from ews204 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews204  Port: win-future  Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Comment 6 BJ Burg 2018-04-22 15:37:35 PDT
Comment on attachment 338558 [details]
Patch

r=me
Comment 7 WebKit Commit Bot 2018-04-22 16:03:50 PDT
Comment on attachment 338558 [details]
Patch

Clearing flags on attachment: 338558

Committed r230903: <https://trac.webkit.org/changeset/230903>
Comment 8 WebKit Commit Bot 2018-04-22 16:03:51 PDT
All reviewed patches have been landed.  Closing bug.