Title: [104593] trunk/Source/WebCore
Revision
104593
Author
[email protected]
Date
2012-01-10 09:57:42 -0800 (Tue, 10 Jan 2012)

Log Message

<rdar://problem/9328684> and https://bugs.webkit.org/show_bug.cgi?id=62764
Frequent crashes due to null frame below ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache

Reviewed by Maciej Stachowiak.

This is a non-reproducible high volume crash, so no test :(.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::stopLoading): Don't re-run actual "stop loading" logic if the document loader is already
  stopping loading. Also add an ASSERT that might catch cases where new loads may have been started while old loads
  were being stopped.
(WebCore::DocumentLoader::detachFromFrame): Be conservative and stop loading when we detach a document loader from a frame.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (104592 => 104593)


--- trunk/Source/WebCore/ChangeLog	2012-01-10 17:49:05 UTC (rev 104592)
+++ trunk/Source/WebCore/ChangeLog	2012-01-10 17:57:42 UTC (rev 104593)
@@ -1,3 +1,18 @@
+2012-01-10  Brady Eidson  <[email protected]>
+
+        <rdar://problem/9328684> and https://bugs.webkit.org/show_bug.cgi?id=62764
+        Frequent crashes due to null frame below ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache
+ 
+        Reviewed by Maciej Stachowiak.
+
+        This is a non-reproducible high volume crash, so no test :(. 
+
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::stopLoading): Don't re-run actual "stop loading" logic if the document loader is already
+          stopping loading. Also add an ASSERT that might catch cases where new loads may have been started while old loads
+          were being stopped.
+        (WebCore::DocumentLoader::detachFromFrame): Be conservative and stop loading when we detach a document loader from a frame. 
+
 2012-01-10  Pavel Feldman  <[email protected]>
 
         Not reviewed: fixing the Mac build.

Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (104592 => 104593)


--- trunk/Source/WebCore/loader/DocumentLoader.cpp	2012-01-10 17:49:05 UTC (rev 104592)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp	2012-01-10 17:57:42 UTC (rev 104593)
@@ -233,8 +233,18 @@
     // Appcache uses ResourceHandle directly, DocumentLoader doesn't count these loads.
     m_applicationCacheHost->stopLoadingInFrame(m_frame);
 
-    if (!loading)
+    if (!loading) {
+        // If something above restarted loading we might run into mysterious crashes like 
+        // https://bugs.webkit.org/show_bug.cgi?id=62764 and <rdar://problem/9328684>
+        ASSERT(!m_loading);
         return;
+    }
+
+    // We might run in to infinite recursion if we're stopping loading as the result of 
+    // detaching from the frame, so break out of that recursion here.
+    // See <rdar://problem/9673866> for more details.
+    if (m_isStopping)
+        return;
     
     RefPtr<Frame> protectFrame(m_frame);
     RefPtr<DocumentLoader> protectLoader(this);
@@ -396,6 +406,10 @@
 {
     ASSERT(m_frame);
 
+    // It never makes sense to have a document loader that is detached from its
+    // frame have any loads active, so go ahead and kill all the loads.
+    stopLoading();
+
     m_applicationCacheHost->setDOMApplicationCache(0);
     InspectorInstrumentation::loaderDetachedFromFrame(m_frame, this);
     m_frame = 0;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to