Closed Bug 1505494 Opened 6 years ago Closed 6 years ago

Crash in mozilla::dom::IsWindowAllowedToPlay

Categories

(Core :: Audio/Video: Playback, defect, P2)

64 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox-esr60 --- unaffected
firefox63 --- unaffected
firefox64 - fixed
firefox65 - fixed

People

(Reporter: philipp, Assigned: alwu)

References

Details

(Keywords: crash, regression)

Crash Data

Attachments

(2 files)

This bug was filed from the Socorro interface and is
report bp-89ce8211-2215-475f-84f3-4d4980181031.
=============================================================

Top 10 frames of crashing thread:

0 xul.dll static bool mozilla::dom::IsWindowAllowedToPlay dom/media/AutoplayPolicy.cpp:94
1 xul.dll static bool mozilla::dom::IsMediaElementAllowedToPlay dom/media/AutoplayPolicy.cpp:148
2 xul.dll mozilla::dom::AutoplayPolicy::IsAllowedToPlay dom/media/AutoplayPolicy.cpp:194
3 xul.dll void mozilla::dom::HTMLMediaElement::UpdatePreloadAction dom/html/HTMLMediaElement.cpp:2505
4 xul.dll mozilla::dom::HTMLMediaElement::AfterSetAttr dom/html/HTMLMediaElement.cpp:4498
5 xul.dll mozilla::dom::Element::SetAttrAndNotify dom/base/Element.cpp:2780
6 xul.dll mozilla::dom::Element::SetAttr dom/base/Element.cpp:2627
7 xul.dll mozilla::dom::HTMLAudioElement::Audio dom/html/HTMLAudioElement.cpp:66
8 xul.dll static bool mozilla::dom::HTMLAudioElement_Binding::_Audio dom/bindings/HTMLAudioElementBinding.cpp:70
9 xul.dll static bool InternalConstruct js/src/vm/Interpreter.cpp:674

=============================================================

this is a tab crash signature starting to show up across platforms in firefox 64. overall it's a fairly low volume crash though.
[Tracking Requested - why for this release]: Uptick, tracking flags, and adjacency to 64 feature policy suggest regression.

Seems like `approver` is null here [1].
Missing null-check on line above calling ApproverDocOf() which appears capable of return null in two cases [2].

As for how to repro or why the uptick... I notice the lines directly above this again check for feature policy, and we recently enabled feature policy in Nightly (available with), maybe this changed things somehow? e.g. is this perhaps happening in a (sandboxed?) iframe with allow="camera;microphone" where things are now maybe more strict in edge cases?

Regardless, adding a null-check would seem prudent, and might be all we need to stop this.

[1] https://hg.mozilla.org/mozilla-central/annotate/c3f01d72374b19dab985700e9b839bb7fa956e77/dom/media/AutoplayPolicy.cpp#l94
[2] https://searchfox.org/mozilla-central/rev/17f55aee76b7c4610a974cffd3453454e0c8de7b/dom/media/AutoplayPolicy.cpp#39,45
Assignee: nobody → alwu
Blocks: 1497141
Has Regression Range: --- → no
Rank: 14
Priority: -- → P2
Yes, we do. Bug 1497034.
Flags: needinfo?(amarchesini)
In order to avoid the nullptr crash when using `approver`.
There are two exactly same codes here, remove one of them.
Not tracking due to low volume; but feel free to request uplift after this is fixed on trunk.
Pushed by alwu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fe1869606e94
not allow autoplay if we don't have a document. r=cpearce
https://hg.mozilla.org/integration/autoland/rev/65987ae1dfca
remove redundant codes. r=cpearce
https://hg.mozilla.org/mozilla-central/rev/fe1869606e94
https://hg.mozilla.org/mozilla-central/rev/65987ae1dfca
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Please request Beta approval on this when you get a chance.
Flags: needinfo?(alwu)
Comment on attachment 9024039 [details]
Bug 1505494 - not allow autoplay if we don't have a document.

[Beta/Release Uplift Approval Request]

Feature/Bug causing the regression: block autoplay

User impact if declined: user might get crash

Is this code covered by automated tests?: No

Has the fix been verified in Nightly?: No

Needs manual test from QE?: No

If yes, steps to reproduce: 

List of other uplifts needed: None

Risk to taking this patch: Low

Why is the change risky/not risky? (and alternatives if risky): This change is only adding a null check

String changes made/needed: no
Flags: needinfo?(alwu)
Attachment #9024039 - Flags: approval-mozilla-beta?
Comment on attachment 9024039 [details]
Bug 1505494 - not allow autoplay if we don't have a document.

fix a low volume crash with block autoplay, approved for 64.0b10
Attachment #9024039 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: