RESOLVED FIXED 193204
Web Inspector: Remote inspector can crash if attempting to navigate inspector page
https://bugs.webkit.org/show_bug.cgi?id=193204
Summary Web Inspector: Remote inspector can crash if attempting to navigate inspector...
Joseph Pecoraro
Reported 2019-01-07 12:21:18 PST
Remote inspector can crash if attempting to navigate inspector page Steps to Reproduce: 1. Open a remote inspector 2. Inspect that inspector 3. In inspector² js> location.href = "http://apple.com" => Inspector crash Crash: ... Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x00000000000005c2 Exception Note: EXC_CORPSE_NOTIFY Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 com.apple.WebKit 0x000000010e4f754b WebKit::WebPageProxy::loadRequest(WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy, API::Object*) + 37 (WebPageProxy.cpp:1068) 1 com.apple.WebKit 0x000000010e572e4c -[WKInspectorViewController webView:decidePolicyForNavigationAction:decisionHandler:] + 281 (utility:898) 2 com.apple.WebKit 0x000000010e494549 WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction(WebKit::WebPageProxy&, WTF::Ref<API::NavigationAction, WTF::DumbPtrTraits<API::NavigationAction> >&&, WTF::Ref<WebKit::WebFramePolicyListenerProxy, WTF::DumbPtrTraits<WebKit::WebFramePolicyListenerProxy> >&&, API::Object*) + 647 ...
Attachments
[PATCH] Proposed Fix (2.36 KB, patch)
2019-01-07 12:22 PST, Joseph Pecoraro
no flags
Joseph Pecoraro
Comment 1 2019-01-07 12:21:28 PST
Joseph Pecoraro
Comment 2 2019-01-07 12:22:20 PST
Created attachment 358512 [details] [PATCH] Proposed Fix
Devin Rousso
Comment 3 2019-01-07 13:45:26 PST
Comment on attachment 358512 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=358512&action=review rs=me, never a bad idea to add a nullptr check 😁 > Source/WebKit/UIProcess/mac/RemoteWebInspectorProxyMac.mm:88 > + m_inspectorView = adoptNS([[WKInspectorViewController alloc] initWithInspectedPage:nullptr]); Just for my knowledge, is it preferred to use `nil` or `nullptr` in ObjC code? Is `nullptr` preferred here because the value expected by `initWithInspectedPage` is a `WebPageProxy`, which is a C++ object, or am I just overthinking things?
Joseph Pecoraro
Comment 4 2019-01-07 13:47:45 PST
Comment on attachment 358512 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=358512&action=review >> Source/WebKit/UIProcess/mac/RemoteWebInspectorProxyMac.mm:88 >> + m_inspectorView = adoptNS([[WKInspectorViewController alloc] initWithInspectedPage:nullptr]); > > Just for my knowledge, is it preferred to use `nil` or `nullptr` in ObjC code? > Is `nullptr` preferred here because the value expected by `initWithInspectedPage` is a `WebPageProxy`, which is a C++ object, or am I just overthinking things? Using nil/nullptr and friends just like where to place the "*", the type is what matters: 0 - never NULL - C type nullptr - C++ type nil - ObjC type Nil - ObjC Class type I think that covers all the various cases.
WebKit Commit Bot
Comment 5 2019-01-07 14:13:37 PST
Comment on attachment 358512 [details] [PATCH] Proposed Fix Clearing flags on attachment: 358512 Committed r239697: <https://trac.webkit.org/changeset/239697>
WebKit Commit Bot
Comment 6 2019-01-07 14:13:38 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.