Bug 214786 - Add null checks in ResourceLoader
Summary: Add null checks in ResourceLoader
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-07-25 10:01 PDT by Alex Christensen
Modified: 2020-07-28 09:31 PDT (History)
6 users (show)

See Also:


Attachments
Patch (4.69 KB, patch)
2020-07-25 10:07 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (4.69 KB, patch)
2020-07-25 11:32 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (4.33 KB, patch)
2020-07-27 23:48 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2020-07-25 10:01:13 PDT
Add null checks in ResourceLoader
Comment 1 Alex Christensen 2020-07-25 10:07:13 PDT
Created attachment 405229 [details]
Patch
Comment 2 Alex Christensen 2020-07-25 11:32:37 PDT
Created attachment 405230 [details]
Patch
Comment 3 Alex Christensen 2020-07-25 12:18:33 PDT
Well it doesn't crash any more, but it doesn't finish loading.  It prints this out:

/Users/.../Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm(258) : void WebCore::WebCoreAVFResourceLoader::startLoading()
ERROR: Failed to start load for media at url data:audio/mp3;base64,//uQx
Comment 4 Geoffrey Garen 2020-07-26 09:09:51 PDT
Ews failure looks real
Comment 5 Alex Christensen 2020-07-27 23:48:07 PDT
Created attachment 405343 [details]
Patch
Comment 6 youenn fablet 2020-07-28 08:53:44 PDT
Comment on attachment 405343 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=405343&action=review

> Source/WebCore/ChangeLog:12
> +        The original patch for this has a test that would reach this code, but it never finishes loading.

Can we do an API test and use a timer to conclude the test (and verify it does not hit some debug assert for instance)?

> Source/WebCore/loader/ResourceLoader.cpp:126
> +    if (!m_documentLoader || !m_documentLoader->frame()) {

Can we keep ASSERT(m_documentLoader)?
Comment 7 Alex Christensen 2020-07-28 09:15:58 PDT
Comment on attachment 405343 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=405343&action=review

>> Source/WebCore/ChangeLog:12
>> +        The original patch for this has a test that would reach this code, but it never finishes loading.
> 
> Can we do an API test and use a timer to conclude the test (and verify it does not hit some debug assert for instance)?

I tried that.  It didn't trigger the crash before the change.  I spent lots of time looking into it.

>> Source/WebCore/loader/ResourceLoader.cpp:126
>> +    if (!m_documentLoader || !m_documentLoader->frame()) {
> 
> Can we keep ASSERT(m_documentLoader)?

No, that would be an invalid assertion.  m_documentLoader can be null here.
Comment 8 EWS 2020-07-28 09:30:39 PDT
Committed r264990: <https://trac.webkit.org/changeset/264990>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 405343 [details].
Comment 9 Radar WebKit Bug Importer 2020-07-28 09:31:20 PDT
<rdar://problem/66221634>