Changes between Version 3 and Version 4 of Abandoned documents


Ignore:
Timestamp:
Aug 18, 2018 1:07:28 PM (6 years ago)
Author:
Simon Fraser
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Abandoned documents

    v3 v4  
    3636}}}
    37377. That confirms that after a memory warning (which clears caches and does a GC) that the document is still alive. So something is holding a reference to it.
     388. Now you could start doing manual debugging of ref() and deref() to try to figure out where the extra ref() is happening. But there's a better way.
     39  1. Apply the most recent patch from [https://bugs.webkit.org/show_bug.cgi?id=186269] (if this has not been checked in yet) and build.
     40  2. Repeat the above steps. Now the output will be something like:
     41{{{
     422 live documents:
     43Document 0x630002400 (refCount 5, referencingNodeCount 1) file:///Volumes/Data/Development/apple/webkit/OpenSource/LayoutTests/fast/forms/textarea-paste-newline.html
     44Document 0x630002400 reference stacks:
     45Backtrace for token 6074
     461   0x6179baa97 WebCore::Node::ref()
     472   0x615af576e unsigned int WTF::refIfNotNull<WebCore::Node>(WebCore::Node*)
     483   0x615af5728 WTF::RefPtr<WebCore::Node, WTF::DumbPtrTraits<WebCore::Node> >::RefPtr(WebCore::Node*)
     494   0x615af4add WTF::RefPtr<WebCore::Node, WTF::DumbPtrTraits<WebCore::Node> >::RefPtr(WebCore::Node*)
     505   0x615af4b73 WTF::RefPtr<WebCore::Node, WTF::DumbPtrTraits<WebCore::Node> >::operator=(WebCore::Node*)
     516   0x61788ccb2 WebCore::Document::removeFocusNavigationNodeOfSubtree(WebCore::Node&, bool)
     527   0x61788c82a WebCore::Document::nodeChildrenWillBeRemoved(WebCore::ContainerNode&)
     538   0x6178252de WebCore::ContainerNode::removeAllChildrenWithScriptAssertion(WebCore::ContainerNode::ChildChangeSource, WebCore::ContainerNode::DeferChildrenChanged)
     549   0x617828d49 WebCore::ContainerNode::removeChildren()
     5510  0x617882aef WebCore::Document::implicitOpen()
     5611  0x617878043 WebCore::Document::open(WebCore::Document*)
     5712  0x617884062 WebCore::Document::write(WebCore::Document*, WebCore::SegmentedString&&)
     5813  0x61788432b WebCore::Document::write(WebCore::Document*, WTF::Vector<WTF::String, 0ul, WTF::CrashOnOverflow, 16ul>&&)
     5914  0x61609d242 WebCore::jsDocumentPrototypeFunctionWriteBody(JSC::ExecState*, WebCore::JSDocument*, JSC::ThrowScope&)
     6015  0x61608046e long long WebCore::IDLOperation<WebCore::JSDocument>::call<&(WebCore::jsDocumentPrototypeFunctionWriteBody(JSC::ExecState*, WebCore::JSDocument*, JSC::ThrowScope&)), (WebCore::CastedThisErrorBehavior)0>(JSC::ExecState&, char const*)
     6116  0x61608016c WebCore::jsDocumentPrototypeFunctionWrite(JSC::ExecState*)
     6217  0xeef1324177
     6318  0x62650d44b llint_entry
     6419  0x62650d44b llint_entry
     6520  0x626504e37 vmEntryToJavaScript
     6621  0x6270a7c7a JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*)
     6722  0x6270a8303 JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
     6823  0x627356dce JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)
     6924  0x627356eac JSC::call(JSC::ExecState*, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtr<JSC::Exception>&)
     7025  0x62735717d JSC::profiledCall(JSC::ExecState*, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtr<JSC::Exception>&)
     7126  0x617351ffb WebCore::JSExecState::profiledCall(JSC::ExecState*, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&, WTF::NakedPtr<JSC::Exception>&)
     7227  0x617398407 WebCore::JSEventListener::handleEvent(WebCore::ScriptExecutionContext&, WebCore::Event&)
     7328  0x617960d3e WebCore::EventTarget::fireEventListeners(WebCore::Event&, WTF::Vector<WTF::RefPtr<WebCore::RegisteredEventListener, WTF::DumbPtrTraits<WebCore::RegisteredEventListener> >, 1ul, WTF::CrashOnOverflow, 16ul>)
     7429  0x61795c7a0 WebCore::EventTarget::fireEventListeners(WebCore::Event&)
     7530  0x61824752d WebCore::DOMWindow::dispatchEvent(WebCore::Event&, WebCore::EventTarget*)
     7631  0x6182523de WebCore::DOMWindow::dispatchLoadEvent()
     7732  0x6178839fa WebCore::Document::dispatchWindowLoadEvent()
     7833  0x61787bff3 WebCore::Document::implicitClose()
     7934  0x6180d6f2b WebCore::FrameLoader::checkCallImplicitClose()
     8035  0x6180d69c8 WebCore::FrameLoader::checkCompleted()
     8136  0x6180d58f5 WebCore::FrameLoader::finishedParsing()
     8237  0x617895ca9 WebCore::Document::finishedParsing()
     8338  0x617e3df58 WebCore::HTMLConstructionSite::finishedParsing()
     8439  0x617e8c969 WebCore::HTMLTreeBuilder::finished()
     8540  0x617e4708c WebCore::HTMLDocumentParser::end()
     8641  0x617e440e9 WebCore::HTMLDocumentParser::attemptToRunDeferredScriptsAndEnd()
     8742  0x617e43de3 WebCore::HTMLDocumentParser::prepareToStopParsing()
     8843  0x617e470ff WebCore::HTMLDocumentParser::attemptToEnd()
     8944  0x617e471d8 WebCore::HTMLDocumentParser::finish()
     9045  0x6180c55fe WebCore::DocumentWriter::end()
     9146  0x618084a1f WebCore::DocumentLoader::finishedLoading()
     9247  0x6180847bf WebCore::DocumentLoader::notifyFinished(WebCore::CachedResource&)
     9348  0x6181c7fdf WebCore::CachedResource::checkNotify()
     9449  0x6181ba091 WebCore::CachedResource::finishLoading(WebCore::SharedBuffer*)
     9550  0x6181c4ec2 WebCore::CachedRawResource::finishLoading(WebCore::SharedBuffer*)
     9651  0x618155a58 WebCore::SubresourceLoader::didFinishLoading(WebCore::NetworkLoadMetrics const&)
     9752  0x610f6d50b WebKit::WebResourceLoader::didFinishResourceLoad(WebCore::NetworkLoadMetrics const&)
     9853  0x610f71b8a 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>)
     9954  0x610f71a10 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&))
     10055  0x610f70bea void IPC::handleMessage<Messages::WebResourceLoader::DidFinishResourceLoad, WebKit::WebResourceLoader, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&)>(IPC::Decoder&, WebKit::WebResourceLoader*, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&))
     10156  0x610f701fc WebKit::WebResourceLoader::didReceiveWebResourceLoaderMessage(IPC::Connection&, IPC::Decoder&)
     10257  0x6103c73a9 WebKit::NetworkProcessConnection::didReceiveMessage(IPC::Connection&, IPC::Decoder&)
     10358  0x610774e3c IPC::Connection::dispatchMessage(IPC::Decoder&)
     10459  0x6107679ad IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >)
     10560  0x6107759f7 IPC::Connection::dispatchOneIncomingMessage()
     10661  0x610793bc8 IPC::Connection::enqueueIncomingMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >)::$_14::operator()()
     10762  0x610793ad9 WTF::Function<void ()>::CallableWrapper<IPC::Connection::enqueueIncomingMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >)::$_14>::call()
     10863  0x62609018f WTF::Function<void ()>::operator()() const
     10964  0x6260e8f83 WTF::RunLoop::performWork()
     11065  0x6260e9934 WTF::RunLoop::performWork(void*)
     11166  0x7fff2e435a11 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
     11267  0x7fff2e4ef42c __CFRunLoopDoSource0
     11368  0x7fff2e418470 __CFRunLoopDoSources0
     11469  0x7fff2e4178ed __CFRunLoopRun
     11570  0x7fff2e417153 CFRunLoopRunSpecific
     11671  0x7fff2d701d96 RunCurrentEventLoopInMode
     11772  0x7fff2d701b06 ReceiveNextEventCommon
     11873  0x7fff2d701884 _BlockUntilNextEventMatchingListInModeWithFilter
     11974  0x7fff2b9b2a73 _DPSNextEvent
     12075  0x7fff2c148e34 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
     12176  0x7fff2b9a7885 -[NSApplication run]
     12277  0x7fff2b976a72 NSApplicationMain
     12378  0x7fff56619d77 _xpc_objc_main
     12479  0x7fff566189ca xpc_main
     12580  0x1091cd077 WebKit::XPCServiceMain()
     12681  0x1091cd36b main
     12782  0x7fff562bf015 start
     12883  0x1
     129
     130Backtrace for token 5651
     1311   0x6179baa97 WebCore::Node::ref()
     1322   0x615d77d88 WTF::Ref<WebCore::Document, WTF::DumbPtrTraits<WebCore::Document> >::Ref(WebCore::Document&)
     1333   0x615d77d4d WTF::Ref<WebCore::Document, WTF::DumbPtrTraits<WebCore::Document> >::Ref(WebCore::Document&)
     1344   0x617396d29 WebCore::toJS(JSC::ExecState*, WebCore::JSDOMGlobalObject*, WebCore::Document&)
     1355   0x6173ad378 WebCore::createWrapperInline(JSC::ExecState*, WebCore::JSDOMGlobalObject*, WTF::Ref<WebCore::Node, WTF::DumbPtrTraits<WebCore::Node> >&&)
     1366   0x6173ad0a0 WebCore::createWrapper(JSC::ExecState*, WebCore::JSDOMGlobalObject*, WTF::Ref<WebCore::Node, WTF::DumbPtrTraits<WebCore::Node> >&&)
     1377   0x615c363de WebCore::toJS(JSC::ExecState*, WebCore::JSDOMGlobalObject*, WebCore::Node&)
     1388   0x615c8fbb0 WebCore::toJS(JSC::ExecState*, WebCore::JSDOMGlobalObject*, WebCore::Node*)
     1399   0x617384fd3 WebCore::JSDOMWindowBase::updateDocument()
     14010  0x6173d677e WebCore::ScriptController::initScriptForWindowProxy(WebCore::JSWindowProxy&)
     14111  0x617457455 WebCore::WindowProxy::createJSWindowProxyWithInitializedScript(WebCore::DOMWrapperWorld&)
     14212  0x6173c70d6 WebCore::WindowProxy::jsWindowProxy(WebCore::DOMWrapperWorld&)
     14313  0x6173d556b WebCore::ScriptController::jsWindowProxy(WebCore::DOMWrapperWorld&)
     14414  0x6173d5355 WebCore::ScriptController::evaluateInWorld(WebCore::ScriptSourceCode const&, WebCore::DOMWrapperWorld&, WebCore::ExceptionDetails*)
     14515  0x6173d57bd WebCore::ScriptController::evaluate(WebCore::ScriptSourceCode const&, WebCore::ExceptionDetails*)
     14616  0x617a04d37 WebCore::ScriptElement::executeClassicScript(WebCore::ScriptSourceCode const&)
     14717  0x617a03084 WebCore::ScriptElement::prepareScript(WTF::TextPosition const&, WebCore::ScriptElement::LegacyTypeSupport)
     14818  0x617e64798 WebCore::HTMLScriptRunner::runScript(WebCore::ScriptElement&, WTF::TextPosition const&)
     14919  0x617e645bf WebCore::HTMLScriptRunner::execute(WTF::Ref<WebCore::ScriptElement, WTF::DumbPtrTraits<WebCore::ScriptElement> >&&, WTF::TextPosition const&)
     15020  0x617e455a3 WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder()
     15121  0x617e45b63 WebCore::HTMLDocumentParser::pumpTokenizerLoop(WebCore::HTMLDocumentParser::SynchronousMode, bool, WebCore::PumpSession&)
     15222  0x617e44684 WebCore::HTMLDocumentParser::pumpTokenizer(WebCore::HTMLDocumentParser::SynchronousMode)
     15323  0x617e43f8f WebCore::HTMLDocumentParser::pumpTokenizerIfPossible(WebCore::HTMLDocumentParser::SynchronousMode)
     15424  0x617e46e9a WebCore::HTMLDocumentParser::append(WTF::RefPtr<WTF::StringImpl, WTF::DumbPtrTraits<WTF::StringImpl> >&&)
     15525  0x61785fe62 WebCore::DecodedDataDocumentParser::flush(WebCore::DocumentWriter&)
     15626  0x6180c55b4 WebCore::DocumentWriter::end()
     15727  0x618084a1f WebCore::DocumentLoader::finishedLoading()
     15828  0x6180847bf WebCore::DocumentLoader::notifyFinished(WebCore::CachedResource&)
     15929  0x6181c7fdf WebCore::CachedResource::checkNotify()
     16030  0x6181ba091 WebCore::CachedResource::finishLoading(WebCore::SharedBuffer*)
     16131  0x6181c4ec2 WebCore::CachedRawResource::finishLoading(WebCore::SharedBuffer*)
     16232  0x618155a58 WebCore::SubresourceLoader::didFinishLoading(WebCore::NetworkLoadMetrics const&)
     16333  0x610f6d50b WebKit::WebResourceLoader::didFinishResourceLoad(WebCore::NetworkLoadMetrics const&)
     16434  0x610f71b8a 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>)
     16535  0x610f71a10 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&))
     16636  0x610f70bea void IPC::handleMessage<Messages::WebResourceLoader::DidFinishResourceLoad, WebKit::WebResourceLoader, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&)>(IPC::Decoder&, WebKit::WebResourceLoader*, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&))
     16737  0x610f701fc WebKit::WebResourceLoader::didReceiveWebResourceLoaderMessage(IPC::Connection&, IPC::Decoder&)
     16838  0x6103c73a9 WebKit::NetworkProcessConnection::didReceiveMessage(IPC::Connection&, IPC::Decoder&)
     16939  0x610774e3c IPC::Connection::dispatchMessage(IPC::Decoder&)
     17040  0x6107679ad IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >)
     17141  0x6107759f7 IPC::Connection::dispatchOneIncomingMessage()
     17242  0x610793bc8 IPC::Connection::enqueueIncomingMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >)::$_14::operator()()
     17343  0x610793ad9 WTF::Function<void ()>::CallableWrapper<IPC::Connection::enqueueIncomingMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >)::$_14>::call()
     17444  0x62609018f WTF::Function<void ()>::operator()() const
     17545  0x6260e8f83 WTF::RunLoop::performWork()
     17646  0x6260e9934 WTF::RunLoop::performWork(void*)
     17747  0x7fff2e435a11 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
     17848  0x7fff2e4ef42c __CFRunLoopDoSource0
     17949  0x7fff2e418470 __CFRunLoopDoSources0
     18050  0x7fff2e4178ed __CFRunLoopRun
     18151  0x7fff2e417153 CFRunLoopRunSpecific
     18252  0x7fff2d701d96 RunCurrentEventLoopInMode
     18353  0x7fff2d701b06 ReceiveNextEventCommon
     18454  0x7fff2d701884 _BlockUntilNextEventMatchingListInModeWithFilter
     18555  0x7fff2b9b2a73 _DPSNextEvent
     18656  0x7fff2c148e34 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
     18757  0x7fff2b9a7885 -[NSApplication run]
     18858  0x7fff2b976a72 NSApplicationMain
     18959  0x7fff56619d77 _xpc_objc_main
     19060  0x7fff566189ca xpc_main
     19161  0x1091cd077 WebKit::XPCServiceMain()
     19262  0x1091cd36b main
     19363  0x7fff562bf015 start
     19464  0x1
     195}}}