Non-fatal decode errors send the media format reader into an update loop

RESOLVED FIXED in Firefox 52

Status

()

Core
Audio/Video: Playback
P1
normal
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: mstange, Assigned: jya)

Tracking

Trunk
mozilla52
Points:
---

Firefox Tracking Flags

(firefox50 affected, firefox52 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(2 attachments)

(Reporter)

Description

a year ago
Created attachment 8796984 [details]
lldb session

My Nightly on macOS is currently using 150% CPU and heating up my machine. An Activity Monitor sample shows that most of the time is spent adding and removing runnables to the TaskQueue on a MediaPlayback thread, and in MediaFormatReader::NotifyError:

[...]
mozilla::TaskQueue::Runner::Run()
mozilla::AutoTaskDispatcher::TaskGroupRunnable::Run()
mozilla::detail::RunnableMethodImpl<[...]>::Run()
mozilla::MediaFormatReader::Update(mozilla::TrackInfo::TrackType)
mozilla::MediaFormatReader::NotifyError(mozilla::TrackInfo::TrackType, mozilla::MediaResult const&)
mozilla::MediaFormatReader::ScheduleUpdate(mozilla::TrackInfo::TrackType)
mozilla::TaskQueue::Dispatch([...])
[...]

MediaFormatReader::Update calls NotifyError here:

  if (decoder.mError && !decoder.HasFatalError()) {
    decoder.mDecodePending = false;
    if (++decoder.mNumOfConsecutiveError > decoder.mMaxConsecutiveError) {
      NotifyError(aTrack, decoder.mError.ref());
      return;
    }

And the fact that NotifyError calls ScheduleUpdate might explain the loop.

After scavenging through the memory in lldb, I found out that decoder.mNumOfConsecutiveError is currently 1256059039 (and keeps increasing, actually it might have looped around a few times by now), decoder.mMaxConsecutiveError is 2, and the decoder.mError.mMessage is "DoDecode: VTDecompressionSessionDecodeFrame:ffffcd93" (and ffffcd93 is -12909).

Is there something that's supposed to stop this loop? My Nightly is still in this state, I could debug some more if anybody has ideas.
I have closed all tabs with videos in them hours ago.
(Assignee)

Updated

a year ago
Assignee: nobody → jyavenard
status-firefox50: --- → affected
(Assignee)

Comment 1

a year ago
error should be fatal... need to force a way to tell to stop
Priority: -- → P1
(Assignee)

Comment 2

a year ago
do you have a link to a video to verify the problem?
Comment hidden (mozreview-request)

Comment 4

a year ago
mozreview-review
Comment on attachment 8798314 [details]
Bug 1307013: Error once number of errors reach threshold.

https://reviewboard.mozilla.org/r/83830/#review82392
Attachment #8798314 - Flags: review?(gsquelart) → review+

Comment 5

a year ago
Pushed by jyavenard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c86d121c0ef5
Error once number of errors reach threshold. r=gerald

Comment 6

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/c86d121c0ef5
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox52: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
(Reporter)

Comment 7

a year ago
(In reply to Jean-Yves Avenard [:jya] from comment #2)
> do you have a link to a video to verify the problem?

Unfortunately I don't know which video caused the problem.
You need to log in before you can comment on or make changes to this bug.