Closed Bug 1285248 Opened 8 years ago Closed 8 years ago

Crash in mozilla::MediaDecoderReaderWrapper::RequestAudioData

Categories

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

Unspecified
macOS
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox48 --- wontfix
firefox50 --- fixed

People

(Reporter: marcia, Assigned: jwwang)

References

Details

(Keywords: crash)

Crash Data

Attachments

(2 files)

This bug was filed from the Socorro interface and is 
report bp-f3ce2f76-5ac8-40ba-9291-40a7b2160707.
=============================================================

Seen while looking at nightly crash stats. Low volume Mac and Windows crash seen on both Nightly and Beta 5 - http://bit.ly/29t6RhM

ni on jwwang since he worked in this code area.
Flags: needinfo?(jwwang)
Component: Audio/Video → Audio/Video: Playback
Hi Gerald,
Taipei office is closed due to typhoon today. Can you review this patch or find someone else?
Thanks!
Flags: needinfo?(jwwang)
Good luck with the weather! I'll have a look...
Assignee: nobody → jwwang
Attachment #8768995 - Flags: review?(gsquelart) → review+
Comment on attachment 8768995 [details]
Bug 1285248. Part 1 - the value of aSeekJob.mTarget.IsVideoOnly() is wrong because the members are reset in the move constructor.

https://reviewboard.mozilla.org/r/62972/#review59916

Seems reasonable to me as a band-aid.
Please make sure you open a new bug to come back to this issue.

If it's not too late in the cycle, please consider this:

::: dom/media/AccurateSeekTask.cpp:110
(Diff revision 1)
> -  MOZ_ASSERT(!mDoneAudioSeeking);
> -  MOZ_ASSERT(!mReader->IsRequestingAudioData());
> -  MOZ_ASSERT(!mReader->IsWaitingAudioData());
> +  //MOZ_ASSERT(!mDoneAudioSeeking);
> +  //MOZ_ASSERT(!mReader->IsRequestingAudioData());
> +  //MOZ_ASSERT(!mReader->IsWaitingAudioData());

Wouldn't it be worth keeping these for a few weeks, and actually changing them to MOZ_DIAGNOSTIC_ASSERT's, so that we can get more information about what's actually wrong, in Nightly&Aurora?
Good idea! I will add more assertions to help debugging.
Review commit: https://reviewboard.mozilla.org/r/63044/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/63044/
Attachment #8768995 - Attachment description: Bug 1285248 - add a band-aid fix to prevent the assertion. → Bug 1285248. Part 1 - the value of aSeekJob.mTarget.IsVideoOnly() is wrong because the members are reset in the move constructor.
Comment on attachment 8768995 [details]
Bug 1285248. Part 1 - the value of aSeekJob.mTarget.IsVideoOnly() is wrong because the members are reset in the move constructor.

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/62972/diff/1-2/
Attachment #8769074 - Flags: review?(gsquelart)
Attachment #8768995 - Flags: review+ → review?(gsquelart)
Comment on attachment 8768995 [details]
Bug 1285248. Part 1 - the value of aSeekJob.mTarget.IsVideoOnly() is wrong because the members are reset in the move constructor.

https://reviewboard.mozilla.org/r/62972/#review59968
Attachment #8768995 - Flags: review?(jwwang)
Attachment #8768995 - Flags: review?(jwwang)
Comment on attachment 8768995 [details]
Bug 1285248. Part 1 - the value of aSeekJob.mTarget.IsVideoOnly() is wrong because the members are reset in the move constructor.

https://reviewboard.mozilla.org/r/62972/#review59972

Confirming r+ for this fix.

::: dom/media/AccurateSeekTask.cpp:48
(Diff revision 2)
>                                     const media::TimeUnit& aEnd,
>                                     int64_t aCurrentMediaTime)
>    : SeekTask(aDecoderID, aThread, aReader, Move(aSeekJob))
>    , mCurrentTimeBeforeSeek(media::TimeUnit::FromMicroseconds(aCurrentMediaTime))
>    , mAudioRate(aInfo.mAudio.mRate)
> -  , mDoneAudioSeeking(!aInfo.HasAudio() || aSeekJob.mTarget.IsVideoOnly())
> +  , mDoneAudioSeeking(!aInfo.HasAudio() || mSeekJob.mTarget.IsVideoOnly())

Good find!
We really need static analysis to find use-after-move issues.
Attachment #8768995 - Flags: review?(gsquelart) → review+
Attachment #8769074 - Flags: review?(gsquelart) → review+
Comment on attachment 8769074 [details]
Bug 1285248. Part 2 - fix logic for video-only seek.

https://reviewboard.mozilla.org/r/63044/#review59974

::: dom/media/AccurateSeekTask.cpp:312
(Diff revision 1)
>    // resolved.
>  
>    SAMPLE_LOG("OnAudioDecoded [%lld,%lld] disc=%d",
>      audio->mTime, audio->GetEndTime(), audio->mDiscontinuity);
>  
> +  // video-only seek doesn't reset audio decoder. There might be pending audio

Nit: 'video' -> 'Video' with capital 'V'.
Thanks for the review!
Comment on attachment 8769074 [details]
Bug 1285248. Part 2 - fix logic for video-only seek.

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/63044/diff/1-2/
Pushed by jwwang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/32de23e9cca6
Part 1 - the value of aSeekJob.mTarget.IsVideoOnly() is wrong because the members are reset in the move constructor. r=gerald
https://hg.mozilla.org/integration/autoland/rev/0aa6ee3eb1d8
Part 2 - fix logic for video-only seek. r=gerald
Blocks: 1282658
Because the volume of crash is small, we don't need to uplift the patch in beta. Let's let it ride on 50.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: