Changeset 246525 in webkit


Ignore:
Timestamp:
Jun 17, 2019 5:14:59 PM (5 years ago)
Author:
achristensen@apple.com
Message:

Fix iOS crash when starting loads with no active DocumentLoader
https://bugs.webkit.org/show_bug.cgi?id=187360
<rdar://problem/29389084>

Reviewed by Geoff Garen.

When FrameLoader::activeDocumentLoader returns null in the ResourceLoader constructor,
on iOS we will dereference it to ask if it has a frame in an early return in init.
Let's not. If we don't have a DocumentLoader, we don't have a frame and should fail.

Crash reports indicate this crash is related to Beacon and other uses of LoaderStrategy::startPingLoad,
but attempts to make a unit test to reproduce the crash were unsuccessful.

  • loader/ResourceLoader.cpp:

(WebCore::ResourceLoader::init):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r246524 r246525  
     12019-06-17  Alex Christensen  <achristensen@webkit.org>
     2
     3        Fix iOS crash when starting loads with no active DocumentLoader
     4        https://bugs.webkit.org/show_bug.cgi?id=187360
     5        <rdar://problem/29389084>
     6
     7        Reviewed by Geoff Garen.
     8
     9        When FrameLoader::activeDocumentLoader returns null in the ResourceLoader constructor,
     10        on iOS we will dereference it to ask if it has a frame in an early return in init.
     11        Let's not.  If we don't have a DocumentLoader, we don't have a frame and should fail.
     12
     13        Crash reports indicate this crash is related to Beacon and other uses of LoaderStrategy::startPingLoad,
     14        but attempts to make a unit test to reproduce the crash were unsuccessful.
     15
     16        * loader/ResourceLoader.cpp:
     17        (WebCore::ResourceLoader::init):
     18
    1192019-06-17  Robin Morisset  <rmorisset@apple.com>
    220
  • trunk/Source/WebCore/loader/ResourceLoader.cpp

    r245508 r246525  
    120120void ResourceLoader::init(ResourceRequest&& clientRequest, CompletionHandler<void(bool)>&& completionHandler)
    121121{
     122#if PLATFORM(IOS_FAMILY)
     123    if (!m_documentLoader) {
     124        // We should always have a DocumentLoader at this point, but crash reports indicate that it is sometimes null.
     125        // See https://bugs.webkit.org/show_bug.cgi?id=187360
     126        ASSERT_NOT_REACHED();
     127        return completionHandler(false);
     128    }
     129#endif
    122130    ASSERT(!m_handle);
    123131    ASSERT(m_request.isNull());
Note: See TracChangeset for help on using the changeset viewer.