Crash in [@ mozilla::MozPromise<T>::Private::Reject<T>] called from AudioSink::Init
Categories
(Core :: Audio/Video: Playback, defect, P3)
Tracking
()
People
(Reporter: aryx, Assigned: alwu)
References
Details
(Keywords: crash)
Crash Data
Attachments
(2 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
Bug 1674597 - part2 : refactor `AudioSinkWrapper::Start` in order to remove unnecessary indentation.
47 bytes,
text/x-phabricator-request
|
Details | Review |
Has hit Nightly and DevEdition (?) builds rarely over the last cycles, got crashes on 3 different installations today.
Crash report: https://crash-stats.mozilla.org/report/index/6c44301f-e00c-4ca7-b900-2ebe80201031
Reason: SIGSEGV /SEGV_MAPERR
Top 10 frames of crashing thread:
0 libxul.so void mozilla::MozPromise<bool, nsresult, false>::Private::Reject<nsresult&> xpcom/threads/MozPromise.h:1145
1 libxul.so mozilla::AudioSink::Init dom/media/mediasink/AudioSink.cpp:97
2 libxul.so mozilla::AudioSinkWrapper::Start dom/media/mediasink/AudioSinkWrapper.cpp:160
3 libxul.so mozilla::VideoSink::Start dom/media/mediasink/VideoSink.cpp:218
4 libxul.so mozilla::MediaDecoderStateMachine::StartMediaSink dom/media/MediaDecoderStateMachine.cpp:3364
5 libxul.so mozilla::MediaDecoderStateMachine::MaybeStartPlayback dom/media/MediaDecoderStateMachine.cpp:2966
6 libxul.so mozilla::MediaDecoderStateMachine::DecodingState::Step dom/media/MediaDecoderStateMachine.cpp:2404
7 libxul.so mozilla::MediaDecoderStateMachine::RunStateMachine dom/media/MediaDecoderStateMachine.cpp:3526
8 libxul.so mozilla::detail::RunnableMethodImpl<mozilla::MediaDecoderStateMachine*, void xpcom/threads/nsThreadUtils.h:1240
9 libxul.so mozilla::AutoTaskDispatcher::TaskGroupRunnable::Run xpcom/threads/TaskDispatcher.h:228
Assignee | ||
Comment 1•3 years ago
|
||
This crash happened inside the promise, indicating that it has been destroyed.
However, we create a promise in [1], so when we call [2], the promise should still exist. And I didn't see any possibility to destroy the promise happening between [1] and [2]...
Paul, do you have any thought about this crash? are you aware any possible recent change which might cause this?
Thank you.
[1] https://searchfox.org/mozilla-central/rev/e75e8e5b980ef18f4596a783fbc8a36621de7d1e/dom/media/mediasink/AudioSink.cpp#94
[2] https://searchfox.org/mozilla-central/rev/e75e8e5b980ef18f4596a783fbc8a36621de7d1e/dom/media/mediasink/AudioSink.cpp#97
Comment 2•3 years ago
|
||
Low volume crash but might be peaking on Nightly. Downgrading to S2.
Comment 3•3 years ago
|
||
I assume the cubeb state callback can be called with DRAINED
if somehow the stream to play is very short. At this point mEndedPromise
would have been resolved, possibly causing this ?
Does this make sense, maybe with a second look ? A fix would be to check the promise state, as it's possible to have a stream that DRAIN
s on its first audio callback (imagine a very very short audio file).
Assignee | ||
Comment 4•3 years ago
|
||
Sounds reasonable, but that is a bad pattern because that ideally we are not expecting to resolve/reject the promise inside InitializeAudioStream()
. Let me think how we can improve this. Thank you.
Comment 5•3 years ago
|
||
Added multiple crash signatures for the same stack. These either come from packaged builds from different Linux distros (so the debug information is slightly different) or different Windows versions where the symbols coming from the Microsoft library have slight differences.
Comment 6•3 years ago
|
||
Top crash signature on Linux for the 11/5 Nightlies, with about 34% of all crashes (31 crashes).
Assignee | ||
Comment 7•3 years ago
|
||
quick update: I've been working on it, will update my patch today if no error is discovered.
Assignee | ||
Comment 8•3 years ago
|
||
Audio stream is the class which really know about whether the audio playback is completed or not. So it makes more sense to let it return and manage the promise for playback end, not audio sink.
Assignee | ||
Comment 9•3 years ago
|
||
Depends on D96468
Comment 10•3 years ago
|
||
Pushed by alwu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5c171eb1f34c part1 : let audio stream to manage the ended promise for playback. r=padenot https://hg.mozilla.org/integration/autoland/rev/16607dd924c5 part2 : refactor `AudioSinkWrapper::Start` in order to remove unnecessary indentation. r=padenot
Comment 11•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5c171eb1f34c
https://hg.mozilla.org/mozilla-central/rev/16607dd924c5
Assignee | ||
Comment 12•3 years ago
|
||
Some singatures are actually related with bug 1675061, not this one.
Updated•3 years ago
|
Description
•