Bug 167766 - CrashTracer: [USER] com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::URL::host const + 9
Summary: CrashTracer: [USER] com.apple.WebKit.WebContent at com.apple.WebCore: WebCore...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-02-02 16:00 PST by Wenson Hsieh
Modified: 2017-02-02 17:03 PST (History)
3 users (show)

See Also:


Attachments
Patch (33.71 KB, patch)
2017-02-02 16:15 PST, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Patch (2.38 KB, patch)
2017-02-02 16:16 PST, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Patch for landing (2.14 KB, patch)
2017-02-02 16:23 PST, Wenson Hsieh
cdumez: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2017-02-02 16:00:59 PST
WebContent crash when vending a media session for the touch bar.
Comment 1 Wenson Hsieh 2017-02-02 16:01:35 PST
<rdar://problem/30132707>
Comment 2 Wenson Hsieh 2017-02-02 16:15:09 PST
Created attachment 300466 [details]
Patch
Comment 3 Wenson Hsieh 2017-02-02 16:16:41 PST
Created attachment 300469 [details]
Patch
Comment 4 Chris Dumez 2017-02-02 16:19:52 PST
Comment on attachment 300469 [details]
Patch

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

r=me with comment.

> Source/WebCore/html/HTMLMediaElement.cpp:586
> +    if (auto document = page.mainFrame().document()) {

We normally prefer earlier returns and auto*.

auto* document = page.mainFrame().document();
if (!document)
    return false;

String host = document->url().host();
return equalLettersIgnoringASCIICase(host, "netflix.com") || host.endsWithIgnoringASCIICase(".netflix.com");
Comment 5 Wenson Hsieh 2017-02-02 16:23:46 PST
Created attachment 300473 [details]
Patch for landing
Comment 6 WebKit Commit Bot 2017-02-02 16:25:28 PST
Comment on attachment 300473 [details]
Patch for landing

Rejecting attachment 300473 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-01', 'validate-changelog', '--check-oops', '--non-interactive', 300473, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

ChangeLog entry in Source/WebCore/ChangeLog contains OOPS!.

Full output: http://webkit-queues.webkit.org/results/2994162
Comment 7 Alexey Proskuryakov 2017-02-02 16:31:19 PST
Comment on attachment 300473 [details]
Patch for landing

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

> Source/WebCore/ChangeLog:10
> +        The mainframe's document pointer may be null when tearing down a page upon navigation to a page that is in the
> +        page cache. If this triggers a GC sweep, we will attempt to reload touch bar media controls, which (as a part of

Is the real bug here that work with side effects is being done during GC sweep? I don't think that it's an OK time for such work.
Comment 8 Chris Dumez 2017-02-02 16:56:32 PST
Comment on attachment 300473 [details]
Patch for landing

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

>> Source/WebCore/ChangeLog:10
>> +        page cache. If this triggers a GC sweep, we will attempt to reload touch bar media controls, which (as a part of
> 
> Is the real bug here that work with side effects is being done during GC sweep? I don't think that it's an OK time for such work.

Alexey is likely right that this work should not be done in the destructor but likely earlier (e.g. removed from document, ...).

That being said, I still think having a null check here makes sense as there is never a guarantee that a frame has a document. It is also a safe change if needed for a branch.
In addition to the null check though, we should find a better place to do this work than the destructor.
Comment 9 Wenson Hsieh 2017-02-02 16:57:45 PST
(In reply to comment #8)
> Comment on attachment 300473 [details]
> Patch for landing
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=300473&action=review
> 
> >> Source/WebCore/ChangeLog:10
> >> +        page cache. If this triggers a GC sweep, we will attempt to reload touch bar media controls, which (as a part of
> > 
> > Is the real bug here that work with side effects is being done during GC sweep? I don't think that it's an OK time for such work.
> 
> Alexey is likely right that this work should not be done in the destructor
> but likely earlier (e.g. removed from document, ...).
> 
> That being said, I still think having a null check here makes sense as there
> is never a guarantee that a frame has a document. It is also a safe change
> if needed for a branch.
> In addition to the null check though, we should find a better place to do
> this work than the destructor.

See also: <rdar://problem/30340495>
Comment 10 Wenson Hsieh 2017-02-02 17:03:01 PST
Committed r211613: <http://trac.webkit.org/changeset/211613>