[webkit-help] ASSERT during fast reload (very interesting case)

Seweryn Pływaczyk s.plywaczyk at gmail.com
Tue Dec 15 05:01:48 PST 2009


Hi all.

I have built WebKit dll and my own test application.

When I send fast LoadUrl request I get the following assert:

ASSERTION FAILED: reachedTerminalState() in
WebCore\loader\MainResourceLoader.cpp:85
WebCore::MainResourceLoader::receivedError

reachedTerminalState() checks m_reachedTerminalState which is set to true
only in releaseResources() method.

During every LoadUrl request, FrameLoader first stops all active loaders.
The key is the following condition in FrameLoader::stopAllLoaders():

if (m_provisionalDocumentLoader)
        m_provisionalDocumentLoader->stopLoading(databasePolicy)
if (m_documentLoader)
        m_documentLoader->stopLoading(databasePolicy);

In case when there is still provisional loader (before commit data) in my
case there is also m_mainResourceLoader what is checked in
DocumentLoader::stopLoading (this is called by
m_provisionalDocumentLoader->stopLoading(databasePolicy))

And here is the problem. To better show this case here it is a call stack:

WEBKIT_CE!WebCore::MainResourceLoader::receivedError()
WEBKIT_CE!WebCore::MainResourceLoader::didFail()
WEBKIT_CE!WebCore::ResourceLoader::didFail()
WEBKIT_CE!WebCore::ResourceHandle::cancel()
WEBKIT_CE!WebCore::ResourceLoader::didCancel()
WEBKIT_CE!WebCore::MainResourceLoader::didCancel()
WEBKIT_CE!WebCore::ResourceLoader::cancel()
WEBKIT_CE!WebCore::ResourceLoader::cancel()
WEBKIT_CE!WebCore::DocumentLoader::stopLoading()
WEBKIT_CE!WebCore::FrameLoader::stopAllLoaders()

ResourceHandle::didCancel() calls releaseResources() at the its end but
first calls m_handle->cancel(). Because I use WinInet, I use implementation
of ResourceHandle from ResourceHandleWin where cancel method calls
a client()->didFail which finally calls (as you can see on the call stack)
MainResourceLoader::receivedError() where the problem is localized.
Normally it calls releaseResources() only if it is not during cancel but in
this case it is and releaseResources() is not called. It would be done by
didCancel() which is not reached because of the mentioned assert)

I really don't know where I should investigate further so if any of you
knows the problem or has any suggestions you are really very welcome :)

Thanks in advance
Regards
Seweryn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20091215/47bc6087/attachment.html>


More information about the webkit-help mailing list