Bug 196954

Summary: Web Inspector: CRASH when reopening tab with docked inspector on crashed page
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, inspector-bugzilla-changes, joepeck, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix none

Description Joseph Pecoraro 2019-04-15 20:33:58 PDT
CRASH when reopening tab with docked inspector on crashed page

Steps to Reproduce:
1. Open Safari window
2. Open a Tab to example.com
3. Inspect example.com
4. Dock inspector
5. Open and focus a second tab
6. Kill the example.com web process
7. Switch back to the example.com tab
  => UIProcess crashes

Crash:
...
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.WebKit              	0x0000000109d7f086 WebKit::WebPageProxy::pageClient() const + 4 (DumbPtrTraits.h:41)
1   com.apple.WebKit              	0x0000000109e2d457 WebKit::WebInspectorProxy::inspectedViewFrameDidChange(double) + 55 (WebPageProxyMac.mm:655)
2   com.apple.WebKit              	0x0000000109e1c629 -[WKInspectorWKWebView viewDidMoveToWindow] + 80 (WKInspectorWKWebView.mm:73)
...
Comment 1 Joseph Pecoraro 2019-04-15 20:34:06 PDT
<rdar://problem/48716433>
Comment 2 Joseph Pecoraro 2019-04-15 20:34:58 PDT
Created attachment 367493 [details]
[PATCH] Proposed Fix
Comment 3 Ryosuke Niwa 2019-04-15 22:56:00 PDT
Comment on attachment 367493 [details]
[PATCH] Proposed Fix

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

> Source/WebKit/ChangeLog:3
> +        Web Inspector: CRASH when reopening tab with docked inspector on crashed page

Is there anyway to write a test for this?
Comment 4 WebKit Commit Bot 2019-04-15 23:22:46 PDT
Comment on attachment 367493 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 367493

Committed r244326: <https://trac.webkit.org/changeset/244326>
Comment 5 WebKit Commit Bot 2019-04-15 23:22:48 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Joseph Pecoraro 2019-04-16 11:28:35 PDT
(In reply to Ryosuke Niwa from comment #3)
> Comment on attachment 367493 [details]
> [PATCH] Proposed Fix
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=367493&action=review
> 
> > Source/WebKit/ChangeLog:3
> > +        Web Inspector: CRASH when reopening tab with docked inspector on crashed page
> 
> Is there anyway to write a test for this?

Hmm, this relied on Safari changing tabs to trigger the -[WKInspectorWKWebView viewDidMoveToWindow]. There might be an API test I could come up with using WKWebViews in NSWindows.