Summary: | Crash when breakpoint hit in unload handler | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Daniel Bates <dbates> | ||||||||||||
Component: | Web Inspector | Assignee: | Matt Baker <mattbaker> | ||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||
Severity: | Normal | CC: | ap, beidson, cdumez, commit-queue, ddkilzer, ews-watchlist, inspector-bugzilla-changes, japhet, joepeck, koivisto, mattbaker, rniwa, webkit-bug-importer | ||||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||||
Version: | WebKit Nightly Build | ||||||||||||||
Hardware: | Mac | ||||||||||||||
OS: | macOS 10.12 | ||||||||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=80427 | ||||||||||||||
Attachments: |
|
Description
Daniel Bates
2017-03-18 16:00:05 PDT
Created attachment 333651 [details]
patch
Created attachment 333662 [details]
patch
Comment on attachment 333662 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=333662&action=review Inspector test looks good to me. The rest too, but should get a more qualified review. > LayoutTests/inspector/debugger/reload-paused.html:16 > + let suite = InspectorTest.createAsyncSuite("Reloading paused page"); I'd prefer a name like "ReloadPaused" > LayoutTests/inspector/debugger/reload-paused.html:19 > + name: "No crash", And here "ReloadPausedNoCrash" Comment on attachment 333662 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=333662&action=review Looks sane to me. r=me > Source/WebCore/ChangeLog:11 > + CachedRawResource::updateBuffer may generate unload event in client notify callback. If Inspector was CachedRawResource::updateBuffer => updateBuffer() > Source/WebCore/ChangeLog:12 > + paused, this even would spawn a nested runloop. CachedRawResource::finishLoading would get called in CachedRawResource::finishLoading => CachedRawResource::finishLoading() > Source/WebCore/ChangeLog:20 > + Set a bit when entering the client callback. > + Ensure we don't re-enter updateBuffer. > + If finishLoading got delayed during client callback, do it at the end. This is OK as-is. I do not see the need to put each sentence on its own line. I suggest you removing the newlines and use the same approach as you did when writing the description for this ChangeLog and break long lines around 100 characters. > Source/WebCore/loader/cache/CachedRawResource.cpp:59 > + // Skip any updateBuffers triggered from nested runloops. We'll have complete buffer in finishLoading. have => have the updateBuffers => updateBuffers() finishLoading => finishLoading() > Source/WebCore/loader/cache/CachedRawResource.cpp:84 > + auto buffer = WTFMove(m_delayedFinishLoadingData->buffer); > + m_delayedFinishLoadingData = std::nullopt; > + finishLoading(buffer.get()); I would have written this as: auto delayedFinishLoadingData = std::exchange(m_delayedFinishLoadingData, std::nullopt); finishLoading(delayedFinishLoadingData->buffer.get()); > Source/WebCore/loader/cache/CachedRawResource.h:96 > + struct DelayedFinishLoadingData { > + RefPtr<SharedBuffer> buffer; > + }; I take it you feel that this struct improves the readability of the code or makes the code less error prone as opposed to using std::optional<RefPtr<SharedBuffer>> or defining DelayedFinishLoadingData to be a type alias for RefPtr<SharedBuffer>. Comment on attachment 333662 [details]
patch
I am assuming that derived classes (e.g. CachedImage) that override CachedResource::{updateBuffer, finishLoading} do not call out to the embedding client or in some way cause reentrancy before calling into the base class (CachedRawResource). Otherwise we would need a similar fix to for derived classes that have this behavior.
This is the stack that messes up the loading state, btw: (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 2.1 * frame #0: 0x00000003fa4e93b6 WebCore`WebCore::DocumentWriter::begin(this=0x000000040e6eb0b0, urlReference=0x00007ffeef05aa80, dispatch=false, ownerDocument=0x0000000000000000) at DocumentWriter.cpp:135 frame #1: 0x00000003fa4ae1ee WebCore`WebCore::DocumentLoader::commitData(this=0x000000040e6eb000, bytes=0x0000000000000000, length=0) at DocumentLoader.cpp:942 frame #2: 0x00000003fa4adc75 WebCore`WebCore::DocumentLoader::finishedLoading(this=0x000000040e6eb000) at DocumentLoader.cpp:425 frame #3: 0x00000003fa4ada5d WebCore`WebCore::DocumentLoader::notifyFinished(this=0x000000040e6eb000, resource=0x000000040f2d7700) at DocumentLoader.cpp:379 frame #4: 0x00000003fa4ade4c WebCore`non-virtual thunk to WebCore::DocumentLoader::notifyFinished(this=0x000000040e6eb000, resource=0x000000040f2d7700) at DocumentLoader.cpp:0 frame #5: 0x00000003fa5d231d WebCore`WebCore::CachedResource::checkNotify(this=0x000000040f2d7700) at CachedResource.cpp:348 frame #6: 0x00000003fa5c5041 WebCore`WebCore::CachedResource::finishLoading(this=0x000000040f2d7700, (null)=0x000000040f295a80) at CachedResource.cpp:364 frame #7: 0x00000003fa5cf41c WebCore`WebCore::CachedRawResource::finishLoading(this=0x000000040f2d7700, data=0x000000040f295a80) at CachedRawResource.cpp:100 frame #8: 0x00000003fa56c7a9 WebCore`WebCore::SubresourceLoader::didFinishLoading(this=0x000000040d7d3000, networkLoadMetrics=0x00007ffeef05b0c8) at SubresourceLoader.cpp:599 frame #9: 0x000000010192559d WebKit`WebKit::WebResourceLoader::didFinishResourceLoad(this=0x000000040f299888, networkLoadMetrics=0x00007ffeef05b0c8) at WebResourceLoader.cpp:150 frame #10: 0x000000010192917a WebKit`void IPC::callMemberFunctionImpl<WebKit::WebResourceLoader, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&), std::__1::tuple<WebCore::NetworkLoadMetrics>, 0ul>(object=0x000000040f299888, function=00 54 92 01 01 00 00 00 00 00 00 00 00 00 00 00, args=0x00007ffeef05b0c8, (null)=std::__1::index_sequence<0UL> @ 0x00007ffeef05aff0)(WebCore::NetworkLoadMetrics const&), std::__1::tuple<WebCore::NetworkLoadMetrics>&&, std::__1::integer_sequence<unsigned long, 0ul>) at HandleMessage.h:40 frame #11: 0x0000000101928fe0 WebKit`void IPC::callMemberFunction<WebKit::WebResourceLoader, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&), std::__1::tuple<WebCore::NetworkLoadMetrics>, std::__1::integer_sequence<unsigned long, 0ul> >(args=0x00007ffeef05b0c8, object=0x000000040f299888, function=00 54 92 01 01 00 00 00 00 00 00 00 00 00 00 00)(WebCore::NetworkLoadMetrics const&)) at HandleMessage.h:46 frame #12: 0x0000000101928346 WebKit`void IPC::handleMessage<Messages::WebResourceLoader::DidFinishResourceLoad, WebKit::WebResourceLoader, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&)>(decoder=0x000000040d722ac8, object=0x000000040f299888, function=00 54 92 01 01 00 00 00 00 00 00 00 00 00 00 00)(WebCore::NetworkLoadMetrics const&)) at HandleMessage.h:126 frame #13: 0x00000001019279bc WebKit`WebKit::WebResourceLoader::didReceiveWebResourceLoaderMessage(this=0x000000040f299888, connection=0x000000040d7ee1b8, decoder=0x000000040d722ac8) at WebResourceLoaderMessageReceiver.cpp:65 frame #14: 0x0000000100f74bd9 WebKit`WebKit::NetworkProcessConnection::didReceiveMessage(this=0x000000040d7dc000, connection=0x000000040d7ee1b8, decoder=0x000000040d722ac8) at NetworkProcessConnection.cpp:69 frame #15: 0x0000000100cfca83 WebKit`IPC::Connection::dispatchMessage(this=0x000000040d7ee1b8, decoder=0x000000040d722ac8) at Connection.cpp:907 frame #16: 0x0000000100cf2068 WebKit`IPC::Connection::dispatchMessage(this=0x000000040d7ee1b8, message=unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> > @ 0x00007ffeef05b7b0) at Connection.cpp:934 frame #17: 0x0000000100cfd08a WebKit`IPC::Connection::dispatchOneMessage(this=0x000000040d7ee1b8) at Connection.cpp:965 frame #18: 0x0000000100d1564d WebKit`IPC::Connection::enqueueIncomingMessage(this=0x000000040d760148)::$_14::operator()() at Connection.cpp:901 frame #19: 0x0000000100d155a9 WebKit`WTF::Function<void ()>::CallableWrapper<IPC::Connection::enqueueIncomingMessage(this=0x000000040d760140)::$_14>::call() at Function.h:101 frame #20: 0x00000004089dbefb JavaScriptCore`WTF::Function<void ()>::operator(this=0x00007ffeef05bc38)() const at Function.h:56 frame #21: 0x0000000408a21043 JavaScriptCore`WTF::RunLoop::performWork(this=0x000000040d7f9000) at RunLoop.cpp:106 frame #22: 0x0000000408a218e4 JavaScriptCore`WTF::RunLoop::performWork(context=0x000000040d7f9000) at RunLoopCF.cpp:38 frame #23: 0x00007fff2ff8e271 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 frame #24: 0x00007fff30047c6c CoreFoundation`__CFRunLoopDoSource0 + 108 frame #25: 0x00007fff2ff70db0 CoreFoundation`__CFRunLoopDoSources0 + 208 frame #26: 0x00007fff2ff7022d CoreFoundation`__CFRunLoopRun + 1293 frame #27: 0x00007fff2ff6fa93 CoreFoundation`CFRunLoopRunSpecific + 483 frame #28: 0x00007fff2f260ef6 HIToolbox`RunCurrentEventLoopInMode + 286 frame #29: 0x00007fff2f260b6f HIToolbox`ReceiveNextEventCommon + 366 frame #30: 0x00007fff2f2609e4 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 64 frame #31: 0x00007fff2d4e94db AppKit`_DPSNextEvent + 2085 frame #32: 0x00007fff2dc7f6f8 AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044 frame #33: 0x00000003f89b5eb8 WebCore`WebCore::EventLoop::cycle(this=0x00007ffeef05d290) at EventLoopMac.mm:40 frame #34: 0x00000003fa3b35c1 WebCore`WebCore::PageScriptDebugServer::runEventLoopWhilePausedInternal(this=0x000000040d7d5038) at PageScriptDebugServer.cpp:121 frame #35: 0x00000003fa3b3545 WebCore`WebCore::PageScriptDebugServer::runEventLoopWhilePaused(this=0x000000040d7d5038) at PageScriptDebugServer.cpp:110 frame #36: 0x00000004081c5624 JavaScriptCore`Inspector::ScriptDebugServer::handlePause(this=0x000000040d7d5038, vmEntryGlobalObject=0x000000040e7fcfb0, (null)=PausedForBreakpoint) at ScriptDebugServer.cpp:301 frame #37: 0x0000000407a3dee1 JavaScriptCore`JSC::Debugger::pauseIfNeeded(this=0x000000040d7d5038, callFrame=0x00007ffeef05d690) at Debugger.cpp:739 frame #38: 0x0000000407a3e1de JavaScriptCore`JSC::Debugger::updateCallFrame(this=0x000000040d7d5038, callFrame=0x00007ffeef05d690, action=AttemptPause) at Debugger.cpp:668 frame #39: 0x0000000407a3e7f3 JavaScriptCore`JSC::Debugger::atStatement(this=0x000000040d7d5038, callFrame=0x00007ffeef05d690) at Debugger.cpp:787 frame #40: 0x000000040821384a JavaScriptCore`JSC::Interpreter::debug(this=0x000000040d7fe728, callFrame=0x00007ffeef05d690, debugHookType=WillExecuteStatement) at Interpreter.cpp:1375 frame #41: 0x00000004082e0073 JavaScriptCore`::llint_slow_path_debug(exec=0x00007ffeef05d690, pc=0x000000040d7d2e40) at LLIntSlowPaths.cpp:1596 frame #42: 0x00000004074f490d JavaScriptCore`llint_entry at LowLevelInterpreter64.asm:58 frame #43: 0x00000004074f3d65 JavaScriptCore`llint_entry at LowLevelInterpreter.asm:832 frame #44: 0x00000004074ebc52 JavaScriptCore`vmEntryToJavaScript at LowLevelInterpreter64.asm:257 frame #45: 0x000000040826c3de JavaScriptCore`JSC::JITCode::execute(this=0x000000040f271988, vm=0x000000040e500000, protoCallFrame=0x00007ffeef05d8d8) at JITCode.cpp:81 frame #46: 0x0000000408211d65 JavaScriptCore`JSC::Interpreter::executeCall(this=0x000000040d7fe728, callFrame=0x000000040e7fd008, function=0x000000040e7ebea0, callType=JS, callData=0x00007ffeef05df20, thisValue=JSValue @ 0x00007ffeef05da00, args=0x00007ffeef05ddf0) at Interpreter.cpp:1028 frame #47: 0x000000040847af1a JavaScriptCore`JSC::call(exec=0x000000040e7fd008, functionObject=JSValue @ 0x00007ffeef05da80, callType=JS, callData=0x00007ffeef05df20, thisValue=JSValue @ 0x00007ffeef05da78, args=0x00007ffeef05ddf0) at CallData.cpp:41 frame #48: 0x000000040847aff9 JavaScriptCore`JSC::call(exec=0x000000040e7fd008, functionObject=JSValue @ 0x00007ffeef05db70, callType=JS, callData=0x00007ffeef05df20, thisValue=JSValue @ 0x00007ffeef05db68, args=0x00007ffeef05ddf0, returnedException=0x00007ffeef05de18) at CallData.cpp:48 frame #49: 0x000000040847b29d JavaScriptCore`JSC::profiledCall(exec=0x000000040e7fd008, reason=Other, functionObject=JSValue @ 0x00007ffeef05dc00, callType=JS, callData=0x00007ffeef05df20, thisValue=JSValue @ 0x00007ffeef05dbf8, args=0x00007ffeef05ddf0, returnedException=0x00007ffeef05de18) at CallData.cpp:67 frame #50: 0x00000003f990eb3b WebCore`WebCore::JSMainThreadExecState::profiledCall(exec=0x000000040e7fd008, reason=Other, functionObject=JSValue @ 0x00007ffeef05dc90, callType=JS, callData=0x00007ffeef05df20, thisValue=JSValue @ 0x00007ffeef05dc88, args=0x00007ffeef05ddf0, returnedException=0x00007ffeef05de18) at JSMainThreadExecState.h:72 frame #51: 0x00000003f994c752 WebCore`WebCore::JSEventListener::handleEvent(this=0x000000040f2cd548, scriptExecutionContext=0x000000040f2cf000, event=0x000000040f2946e0) at JSEventListener.cpp:169 frame #52: 0x00000003f9ebb392 WebCore`WebCore::EventTarget::fireEventListeners(this=0x000000040d7e1d40, event=0x000000040f2946e0, listeners=WebCore::EventListenerVector @ 0x00007ffeef05e158) at EventTarget.cpp:290 frame #53: 0x00000003f9eb2dea WebCore`WebCore::EventTarget::fireEventListeners(this=0x000000040d7e1d40, event=0x000000040f2946e0) at EventTarget.cpp:232 frame #54: 0x00000003fa63dab1 WebCore`WebCore::DOMWindow::dispatchEvent(this=0x000000040d7e1d40, event=0x000000040f2946e0, target=0x000000040f2cf000) at DOMWindow.cpp:2064 frame #55: 0x00000003fa4f91ec WebCore`WebCore::FrameLoader::dispatchUnloadEvents(this=0x00007fd8c5436100, unloadEventPolicy=UnloadEventPolicyUnloadAndPageHide) at FrameLoader.cpp:3039 frame #56: 0x00000003fa4f8db5 WebCore`WebCore::FrameLoader::stopLoading(this=0x00007fd8c5436100, unloadEventPolicy=UnloadEventPolicyUnloadAndPageHide) at FrameLoader.cpp:472 frame #57: 0x00000003fa4f96e5 WebCore`WebCore::FrameLoader::closeURL(this=0x00007fd8c5436100) at FrameLoader.cpp:537 frame #58: 0x00000003fa5055a5 WebCore`WebCore::FrameLoader::detachFromParent(this=0x00007fd8c5436100) at FrameLoader.cpp:2585 frame #59: 0x00000003fa4fd890 WebCore`WebCore::FrameLoader::detachChildren(this=0x00007fd8c5538310) at FrameLoader.cpp:2504 frame #60: 0x00000003fa4f764b WebCore`WebCore::FrameLoader::setDocumentLoader(this=0x00007fd8c5538310, loader=0x000000040e6eb000) at FrameLoader.cpp:1775 frame #61: 0x00000003fa503046 WebCore`WebCore::FrameLoader::transitionToCommitted(this=0x00007fd8c5538310, cachedPage=0x0000000000000000) at FrameLoader.cpp:1998 frame #62: 0x00000003fa50235a WebCore`WebCore::FrameLoader::commitProvisionalLoad(this=0x00007fd8c5538310) at FrameLoader.cpp:1871 frame #63: 0x00000003fa4ad8ec WebCore`WebCore::DocumentLoader::commitIfReady(this=0x000000040e6eb000) at DocumentLoader.cpp:354 frame #64: 0x00000003fa4b1fec WebCore`WebCore::DocumentLoader::commitLoad(this=0x000000040e6eb000, data="<!DOCTYPE html>\n<html>\n<head>\n</head>\n<body>\n<iframe src=\"unload-with-inspector-at-breakpoint-crash-frame.html\" width=\"500\" height=\"500\"></iframe>\n</body>\n</html>", length=162) at DocumentLoader.cpp:903 frame #65: 0x00000003fa4b1f8f WebCore`WebCore::DocumentLoader::dataReceived(this=0x000000040e6eb000, data="<!DOCTYPE html>\n<html>\n<head>\n</head>\n<body>\n<iframe src=\"unload-with-inspector-at-breakpoint-crash-frame.html\" width=\"500\" height=\"500\"></iframe>\n</body>\n</html>", length=162) at DocumentLoader.cpp:1050 frame #66: 0x00000003fa4b2894 WebCore`WebCore::DocumentLoader::dataReceived(this=0x000000040e6eb000, resource=0x000000040f2d7700, data="<!DOCTYPE html>\n<html>\n<head>\n</head>\n<body>\n<iframe src=\"unload-with-inspector-at-breakpoint-crash-frame.html\" width=\"500\" height=\"500\"></iframe>\n</body>\n</html>", length=162) at DocumentLoader.cpp:1023 frame #67: 0x00000003fa4b28da WebCore`non-virtual thunk to WebCore::DocumentLoader::dataReceived(this=0x000000040e6eb000, resource=0x000000040f2d7700, data="<!DOCTYPE html>\n<html>\n<head>\n</head>\n<body>\n<iframe src=\"unload-with-inspector-at-breakpoint-crash-frame.html\" width=\"500\" height=\"500\"></iframe>\n</body>\n</html>", length=162) at DocumentLoader.cpp:0 frame #68: 0x00000003fa5cf178 WebCore`WebCore::CachedRawResource::notifyClientsDataWasReceived(this=0x000000040f2d7700, data="<!DOCTYPE html>\n<html>\n<head>\n</head>\n<body>\n<iframe src=\"unload-with-inspector-at-breakpoint-crash-frame.html\" width=\"500\" height=\"500\"></iframe>\n</body>\n</html>", length=162) at CachedRawResource.cpp:116 frame #69: 0x00000003fa5cf00d WebCore`WebCore::CachedRawResource::updateBuffer(this=0x000000040f2d7700, data=0x000000040f295a80) at CachedRawResource.cpp:65 frame #70: 0x00000003fa56de6a WebCore`WebCore::SubresourceLoader::didReceiveDataOrBuffer(this=0x000000040d7d3000, data="<!DOCTYPE html>\n<html>\n<head>\n</head>\n<body>\n<iframe src=\"unload-with-inspector-at-breakpoint-crash-frame.html\" width=\"500\" height=\"500\"></iframe>\n</body>\n</html>", length=162, buffer=0x00007ffeef05f3f0, encodedDataLength=162, dataPayloadType=DataPayloadBytes) at SubresourceLoader.cpp:430 frame #71: 0x00000003fa56dc32 WebCore`WebCore::SubresourceLoader::didReceiveData(this=0x000000040d7d3000, data="<!DOCTYPE html>\n<html>\n<head>\n</head>\n<body>\n<iframe src=\"unload-with-inspector-at-breakpoint-crash-frame.html\" width=\"500\" height=\"500\"></iframe>\n</body>\n</html>", length=162, encodedDataLength=162, dataPayloadType=DataPayloadBytes) at SubresourceLoader.cpp:398 frame #72: 0x00000001019252d4 WebKit`WebKit::WebResourceLoader::didReceiveData(this=0x000000040f299888, data=0x00007ffeef05f5f0, encodedDataLength=162) at WebResourceLoader.cpp:134 frame #73: 0x0000000101928f40 WebKit`void IPC::callMemberFunctionImpl<WebKit::WebResourceLoader, void (WebKit::WebResourceLoader::*)(IPC::DataReference const&, long long), std::__1::tuple<IPC::DataReference, long long>, 0ul, 1ul>(object=0x000000040f299888, function=e0 50 92 01 01 00 00 00 00 00 00 00 00 00 00 00, args=0x00007ffeef05f5f0, (null)=std::__1::index_sequence<0UL, 1UL> @ 0x00007ffeef05f4f8)(IPC::DataReference const&, long long), std::__1::tuple<IPC::DataReference, long long>&&, std::__1::integer_sequence<unsigned long, 0ul, 1ul>) at HandleMessage.h:40 frame #74: 0x0000000101928e70 WebKit`void IPC::callMemberFunction<WebKit::WebResourceLoader, void (WebKit::WebResourceLoader::*)(IPC::DataReference const&, long long), std::__1::tuple<IPC::DataReference, long long>, std::__1::integer_sequence<unsigned long, 0ul, 1ul> >(args=0x00007ffeef05f5f0, object=0x000000040f299888, function=e0 50 92 01 01 00 00 00 00 00 00 00 00 00 00 00)(IPC::DataReference const&, long long)) at HandleMessage.h:46 frame #75: 0x0000000101928201 WebKit`void IPC::handleMessage<Messages::WebResourceLoader::DidReceiveData, WebKit::WebResourceLoader, void (WebKit::WebResourceLoader::*)(IPC::DataReference const&, long long)>(decoder=0x000000040d722a50, object=0x000000040f299888, function=e0 50 92 01 01 00 00 00 00 00 00 00 00 00 00 00)(IPC::DataReference const&, long long)) at HandleMessage.h:126 frame #76: 0x0000000101927936 WebKit`WebKit::WebResourceLoader::didReceiveWebResourceLoaderMessage(this=0x000000040f299888, connection=0x000000040d7ee1b8, decoder=0x000000040d722a50) at WebResourceLoaderMessageReceiver.cpp:61 frame #77: 0x0000000100f74bd9 WebKit`WebKit::NetworkProcessConnection::didReceiveMessage(this=0x000000040d7dc000, connection=0x000000040d7ee1b8, decoder=0x000000040d722a50) at NetworkProcessConnection.cpp:69 frame #78: 0x0000000100cfca83 WebKit`IPC::Connection::dispatchMessage(this=0x000000040d7ee1b8, decoder=0x000000040d722a50) at Connection.cpp:907 frame #79: 0x0000000100cf2068 WebKit`IPC::Connection::dispatchMessage(this=0x000000040d7ee1b8, message=unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> > @ 0x00007ffeef05fbe0) at Connection.cpp:934 frame #80: 0x0000000100cfd08a WebKit`IPC::Connection::dispatchOneMessage(this=0x000000040d7ee1b8) at Connection.cpp:965 frame #81: 0x0000000100d1564d WebKit`IPC::Connection::enqueueIncomingMessage(this=0x000000040d760138)::$_14::operator()() at Connection.cpp:901 frame #82: 0x0000000100d155a9 WebKit`WTF::Function<void ()>::CallableWrapper<IPC::Connection::enqueueIncomingMessage(this=0x000000040d760130)::$_14>::call() at Function.h:101 frame #83: 0x00000004089dbefb JavaScriptCore`WTF::Function<void ()>::operator(this=0x00007ffeef060068)() const at Function.h:56 frame #84: 0x0000000408a21043 JavaScriptCore`WTF::RunLoop::performWork(this=0x000000040d7f9000) at RunLoop.cpp:106 frame #85: 0x0000000408a218e4 JavaScriptCore`WTF::RunLoop::performWork(context=0x000000040d7f9000) at RunLoopCF.cpp:38 frame #86: 0x00007fff2ff8e271 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 frame #87: 0x00007fff30047c6c CoreFoundation`__CFRunLoopDoSource0 + 108 frame #88: 0x00007fff2ff70db0 CoreFoundation`__CFRunLoopDoSources0 + 208 frame #89: 0x00007fff2ff7022d CoreFoundation`__CFRunLoopRun + 1293 frame #90: 0x00007fff2ff6fa93 CoreFoundation`CFRunLoopRunSpecific + 483 frame #91: 0x00007fff2f260ef6 HIToolbox`RunCurrentEventLoopInMode + 286 frame #92: 0x00007fff2f260c66 HIToolbox`ReceiveNextEventCommon + 613 frame #93: 0x00007fff2f2609e4 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 64 frame #94: 0x00007fff2d4e94db AppKit`_DPSNextEvent + 2085 frame #95: 0x00007fff2dc7f6f8 AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044 frame #96: 0x00007fff2d4de2ed AppKit`-[NSApplication run] + 764 frame #97: 0x00007fff2d4ad4c6 AppKit`NSApplicationMain + 804 frame #98: 0x00007fff58a75f83 libxpc.dylib`_xpc_objc_main + 580 frame #99: 0x00007fff58a74bd6 libxpc.dylib`xpc_main + 417 frame #100: 0x0000000100b9f13b com.apple.WebKit.WebContent.Development`main(argc=1, argv=0x00007ffeef061a18) at XPCServiceMain.mm:148 frame #101: 0x00007fff58727015 libdyld.dylib`start + 1 frame #102: 0x00007fff58727015 libdyld.dylib`start + 1
> > I take it you feel that this struct improves the readability of the code or
> makes the code less error prone as opposed to using
> std::optional<RefPtr<SharedBuffer>> or defining DelayedFinishLoadingData to
> be a type alias for RefPtr<SharedBuffer>.
Yeah, nullable types as optionals can be bit awkward and confusing.
(In reply to Daniel Bates from comment #6) > Comment on attachment 333662 [details] > patch > > I am assuming that derived classes (e.g. CachedImage) that override > CachedResource::{updateBuffer, finishLoading} do not call out to the > embedding client or in some way cause reentrancy before calling into the > base class (CachedRawResource). Otherwise we would need a similar fix to for > derived classes that have this behavior. Most subtypes don't stream the data at all or the streaming won't cause events to be sent. It is still possible that something else has the same problem, however it is better to do a conservative fix at this point. Created attachment 333697 [details]
for landing
Created attachment 333698 [details]
for landing
Comment on attachment 333698 [details] for landing Clearing flags on attachment: 333698 Committed r228435: <https://trac.webkit.org/changeset/228435> All reviewed patches have been landed. Closing bug. |