Bug 191814

Summary: Regression(r238330): A lot of WebInspector tests are crashing on the bots
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, hi, inspector-bugzilla-changes, joepeck, rniwa, ryanhaddad, timothy, tsavell, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=191812
Bug Depends on:    
Bug Blocks: 191740    
Attachments:
Description Flags
[PATCH] Proposed Fix
none
[PATCH] Proposed Fix none

Description Chris Dumez 2018-11-17 14:20:04 PST
A lot of WebInspector tests are crashing on the bots:
https://build.webkit.org/results/Apple%20High%20Sierra%20Debug%20WK2%20(Tests)/r238350%20(5589)/results.html

I believe this started with PSON support.

Crash:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.JavaScriptCore      	0x00000002890826e0 WTFCrash + 16 (Assertions.cpp:255)
1   com.apple.WebCore             	0x000000027800b92b WTFCrashWithInfo(int, char const*, char const*, int) + 27
2   com.apple.WebCore             	0x000000027a7350a0 WebCore::InspectorController::show() + 112 (InspectorController.cpp:356)
3   com.apple.WebKit              	0x00000001036f482c WebKit::WebInspector::show() + 76 (WebInspector.cpp:126)
4   com.apple.WebKit              	0x00000001035275fd WKBundleInspectorShow + 29 (WKBundleInspector.cpp:44)
5   com.apple.WebKitTestRunner.InjectedBundle	0x0000000290a55441 WTR::TestRunner::showWebInspector() + 49 (TestRunner.cpp:635)
6   com.apple.WebKitTestRunner.InjectedBundle	0x0000000290a4a1d7 WTR::JSTestRunner::showWebInspector(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) + 87 (JSTestRunner.cpp:1301)
7   com.apple.JavaScriptCore      	0x00000002895c0f31 long long JSC::APICallbackFunction::call<JSC::JSCallbackFunction>(JSC::ExecState*) + 577 (APICallbackFunction.h:63)
8   ???                           	0x0000031bb609a02d 0 + 3417553084461
9   com.apple.JavaScriptCore      	0x000000028953cd3d llint_entry + 77901
10  com.apple.JavaScriptCore      	0x000000028953cd3d llint_entry + 77901
11  com.apple.JavaScriptCore      	0x0000000289529a79 vmEntryToJavaScript + 273
12  com.apple.JavaScriptCore      	0x000000028a17659e JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 206 (JITCodeInlines.h:38)
13  com.apple.JavaScriptCore      	0x000000028a176c39 JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 1433 (Interpreter.cpp:891)
14  com.apple.JavaScriptCore      	0x000000028a43e52c JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 236 (CallData.cpp:41)
15  com.apple.JavaScriptCore      	0x000000028a43e61a JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtr<JSC::Exception>&) + 218 (CallData.cpp:48)
16  com.apple.JavaScriptCore      	0x000000028a43e90e JSC::profiledCall(JSC::ExecState*, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtr<JSC::Exception>&) + 142 (CallData.cpp:69)
17  com.apple.WebCore             	0x0000000279b7c11b WebCore::JSExecState::profiledCall(JSC::ExecState*, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtr<JSC::Exception>&) + 139 (JSExecState.h:74)
18  com.apple.WebCore             	0x0000000279bbfa94 WebCore::JSEventListener::handleEvent(WebCore::ScriptExecutionContext&, WebCore::Event&) + 2004 (JSEventListener.cpp:175)
19  com.apple.WebCore             	0x000000027a190aec WebCore::EventTarget::innerInvokeEventListeners(WebCore::Event&, WTF::Vector<WTF::RefPtr<WebCore::RegisteredEventListener, WTF::DumbPtrTraits<WebCore::RegisteredEventListener> >, 1ul, WTF::CrashOnOverflow, 16ul>, WebCore::EventTarget::EventInvokePhase) + 1020 (EventTarget.cpp:302)
20  com.apple.WebCore             	0x000000027a18c4c2 WebCore::EventTarget::fireEventListeners(WebCore::Event&, WebCore::EventTarget::EventInvokePhase) + 354 (EventTarget.cpp:242)
21  com.apple.WebCore             	0x000000027aa7d1e1 WebCore::DOMWindow::dispatchEvent(WebCore::Event&, WebCore::EventTarget*) + 449 (DOMWindow.cpp:2027)
22  com.apple.WebCore             	0x000000027aa87495 WebCore::DOMWindow::dispatchLoadEvent() + 309 (DOMWindow.cpp:1976)
23  com.apple.WebCore             	0x000000027a0ad768 WebCore::Document::dispatchWindowLoadEvent() + 136 (Document.cpp:4536)
24  com.apple.WebCore             	0x000000027a0a5d33 WebCore::Document::implicitClose() + 547 (Document.cpp:2959)
25  com.apple.WebCore             	0x000000027a918c4b WebCore::FrameLoader::checkCallImplicitClose() + 155 (FrameLoader.cpp:952)
26  com.apple.WebCore             	0x000000027a9186e4 WebCore::FrameLoader::checkCompleted() + 532 (FrameLoader.cpp:894)
27  com.apple.WebCore             	0x000000027a91875d WebCore::FrameLoader::loadDone(WebCore::LoadCompletionType) + 45 (FrameLoader.cpp:794)
28  com.apple.WebCore             	0x000000027aa144f6 WebCore::CachedResourceLoader::loadDone(WebCore::LoadCompletionType, bool) + 214 (CachedResourceLoader.cpp:1319)
29  com.apple.WebCore             	0x000000027a98d3cd WebCore::SubresourceLoader::notifyDone(WebCore::LoadCompletionType) + 125 (SubresourceLoader.cpp:743)
30  com.apple.WebCore             	0x000000027a98b178 WebCore::SubresourceLoader::didFinishLoading(WebCore::NetworkLoadMetrics const&) + 984 (SubresourceLoader.cpp:644)
31  com.apple.WebKit              	0x000000010355f55d WebKit::WebResourceLoader::didFinishResourceLoad(WebCore::NetworkLoadMetrics const&) + 445 (WebResourceLoader.cpp:162)
32  com.apple.WebKit              	0x000000010392e92a void IPC::callMemberFunctionImpl<WebKit::WebResourceLoader, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&), std::__1::tuple<WebCore::NetworkLoadMetrics>, 0ul>(WebKit::WebResourceLoader*, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&), std::__1::tuple<WebCore::NetworkLoadMetrics>&&, std::__1::integer_sequence<unsigned long, 0ul>) + 154 (HandleMessage.h:42)
33  com.apple.WebKit              	0x000000010392e7b0 void IPC::callMemberFunction<WebKit::WebResourceLoader, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&), std::__1::tuple<WebCore::NetworkLoadMetrics>, std::__1::integer_sequence<unsigned long, 0ul> >(std::__1::tuple<WebCore::NetworkLoadMetrics>&&, WebKit::WebResourceLoader*, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&)) + 96 (HandleMessage.h:48)
34  com.apple.WebKit              	0x000000010392d8f8 void IPC::handleMessage<Messages::WebResourceLoader::DidFinishResourceLoad, WebKit::WebResourceLoader, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&)>(IPC::Decoder&, WebKit::WebResourceLoader*, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&)) + 296 (HandleMessage.h:134)
35  com.apple.WebKit              	0x000000010392cf2c WebKit::WebResourceLoader::didReceiveWebResourceLoaderMessage(IPC::Connection&, IPC::Decoder&) + 636 (WebResourceLoaderMessageReceiver.cpp:67)
36  com.apple.WebKit              	0x0000000103550546 WebKit::NetworkProcessConnection::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 166 (NetworkProcessConnection.cpp:79)
37  com.apple.WebKit              	0x000000010271c2dc IPC::Connection::dispatchMessage(IPC::Decoder&) + 476 (Connection.cpp:979)
38  com.apple.WebKit              	0x000000010270e6f1 IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >) + 721
39  com.apple.WebKit              	0x000000010271d0a7 IPC::Connection::dispatchOneIncomingMessage() + 1607 (Connection.cpp:1074)
40  com.apple.WebKit              	0x000000010273dbb8 IPC::Connection::enqueueIncomingMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >)::$_14::operator()() + 104 (Connection.cpp:957)
41  com.apple.WebKit              	0x000000010273dac9 WTF::Function<void ()>::CallableWrapper<IPC::Connection::enqueueIncomingMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >)::$_14>::call() + 25 (Function.h:101)
42  com.apple.JavaScriptCore      	0x00000002890a9efd WTF::Function<void ()>::operator()() const + 173 (Function.h:56)
43  com.apple.JavaScriptCore      	0x0000000289102c9d WTF::RunLoop::performWork() + 445 (RunLoop.cpp:124)
44  com.apple.JavaScriptCore      	0x0000000289103544 WTF::RunLoop::performWork(void*) + 36 (RunLoopCF.cpp:38)
45  com.apple.CoreFoundation      	0x00007fff38eb9d81 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
46  com.apple.CoreFoundation      	0x00007fff38f7165c __CFRunLoopDoSource0 + 108
47  com.apple.CoreFoundation      	0x00007fff38e9cd30 __CFRunLoopDoSources0 + 208
48  com.apple.CoreFoundation      	0x00007fff38e9c1ad __CFRunLoopRun + 1293
49  com.apple.CoreFoundation      	0x00007fff38e9ba07 CFRunLoopRunSpecific + 487
50  com.apple.HIToolbox           	0x00007fff38179d96 RunCurrentEventLoopInMode + 286
51  com.apple.HIToolbox           	0x00007fff38179b06 ReceiveNextEventCommon + 613
52  com.apple.HIToolbox           	0x00007fff38179884 _BlockUntilNextEventMatchingListInModeWithFilter + 64
53  com.apple.AppKit              	0x00007fff3642ca73 _DPSNextEvent + 2085
54  com.apple.AppKit              	0x00007fff36bc2e34 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044
55  com.apple.AppKit              	0x00007fff36421885 -[NSApplication run] + 764
56  com.apple.AppKit              	0x00007fff363f0a72 NSApplicationMain + 804
57  libxpc.dylib                  	0x00007fff6159af57 _xpc_objc_main + 580
58  libxpc.dylib                  	0x00007fff61599baa xpc_main + 417
59  com.apple.WebKit.WebContent   	0x00000001026c3084 WebKit::XPCServiceMain(int, char const**) + 1188
60  com.apple.WebKit.WebContent   	0x00000001026c3372 main + 34
61  libdyld.dylib                 	0x00007fff61240015 start + 1
Comment 1 Chris Dumez 2018-11-17 14:21:02 PST
ASSERT(!hasRemoteFrontend()); in InspectorController::show().
Comment 2 Joseph Pecoraro 2018-11-18 21:58:56 PST
Created attachment 355254 [details]
[PATCH] Proposed Fix
Comment 3 Joseph Pecoraro 2018-11-18 22:02:57 PST
I don't know how I did not catch this in my own local testing or EWS when the patch first went up...
Comment 4 Chris Dumez 2018-11-18 22:06:25 PST
Comment on attachment 355254 [details]
[PATCH] Proposed Fix

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

> Source/WebKit/UIProcess/WebPageInspectorTargetAgent.h:32
> +class WebPageInspectorTargetAgent final : public Inspector::InspectorTargetAgent, Inspector::FrontendChannel {

Shouldn’t this be public inheritance?
Comment 5 Chris Dumez 2018-11-18 22:07:03 PST
(In reply to Joseph Pecoraro from comment #3)
> I don't know how I did not catch this in my own local testing or EWS when
> the patch first went up...

There is no debug wk2 EWS.
Comment 6 Joseph Pecoraro 2018-11-18 22:10:00 PST
Comment on attachment 355254 [details]
[PATCH] Proposed Fix

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

>> Source/WebKit/UIProcess/WebPageInspectorTargetAgent.h:32
>> +class WebPageInspectorTargetAgent final : public Inspector::InspectorTargetAgent, Inspector::FrontendChannel {
> 
> Shouldn’t this be public inheritance?

Ahh, yes I'll do that.
Comment 7 Joseph Pecoraro 2018-11-18 22:12:34 PST
Created attachment 355256 [details]
[PATCH] Proposed Fix
Comment 8 WebKit Commit Bot 2018-11-19 01:13:56 PST
Comment on attachment 355256 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 355256

Committed r238370: <https://trac.webkit.org/changeset/238370>
Comment 9 WebKit Commit Bot 2018-11-19 01:13:58 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2018-11-19 01:14:27 PST
<rdar://problem/46164164>