Crash in mozilla::AudioMixer::FinishMixing
Categories
(Core :: Audio/Video: MediaStreamGraph, defect, P1)
Tracking
()
People
(Reporter: jesup, Assigned: pehrsons)
References
Details
(Keywords: crash, csectype-uaf, sec-high)
Crash Data
| Reporter | ||
Updated•8 years ago
|
Comment 1•8 years ago
|
||
| Reporter | ||
Updated•8 years ago
|
Comment 2•8 years ago
|
||
Updated•8 years ago
|
Comment 3•8 years ago
|
||
Comment 4•8 years ago
|
||
Updated•8 years ago
|
Comment 5•8 years ago
|
||
Comment 6•8 years ago
|
||
Comment 7•8 years ago
|
||
Comment 8•8 years ago
|
||
Comment 9•8 years ago
|
||
Updated•8 years ago
|
Comment 10•8 years ago
|
||
Comment 11•8 years ago
|
||
Comment 12•8 years ago
|
||
Comment 13•7 years ago
|
||
| Reporter | ||
Comment 14•7 years ago
|
||
This crash is still occurring; there are still clear UAFs such as https://crash-stats.mozilla.com/report/index/8ae31e2d-3335-4e56-9dd6-86e4f0181220
Something is likely going wrong with switchover of drivers... perhaps something not locked correctly, or that should be atomic and isn't.
Added Andreas who should be on this bug.
Updated•7 years ago
|
| Assignee | ||
Comment 15•7 years ago
|
||
FWIW I see similar crashes for both GraphDriver and AudioStream data callbacks.
Comment 16•7 years ago
|
||
Andreas, could you as the MSG expert please take a close look at this?
Is it possible that any of your refactoring is going to fix this?
| Assignee | ||
Comment 17•7 years ago
|
||
Sure, I'll take a look - keeping the needinfo until I do. It's one of these that seem really tricky though, so it might be a bit of a rabbit hole.
I doubt my refactoring fixes this. This seems more like an audio callback that is holding on to a rawptr to a graph or driver that we already destroyed.
| Assignee | ||
Updated•7 years ago
|
| Assignee | ||
Comment 18•7 years ago
|
||
kinetik, can you take a look at [1]?
This is a failure mode on Windows where we crash on 0xffffffffffffffff. There's another that crashes on 0x0 or somewhere close that I for now assume is different.
This one is crashing on an AsyncCubebOperation thread after winmm_stream_init calls into winmm_refill_stream at [2]. At the same time there's thread #40 blocked in winmm_buffer_thread at [3], which is where the responsibility to call winmm_refill_stream normally lies. Can you comment on whether this is expected?
I find it surprising that AudioCallbackDriver::Init() leads to calling a DataCallback synchronously. Is this expected?
That these two threads are active at the same time doesn't seem like a coincidence wrt reaching this crash. There's a similar pattern in the older report at [4] too. [5] crashes similarly but is wasapi and the threading situation looks completely different.
[1] https://crash-stats.mozilla.com/report/index/22990879-c01c-4798-ba58-e57230190322
[2] https://hg.mozilla.org/releases/mozilla-release/annotate/164a57c0cdf0088e786e6b966e34fdd3799671d1/media/libcubeb/src/cubeb_winmm.c#l536
[3] https://hg.mozilla.org/releases/mozilla-release/annotate/164a57c0cdf0088e786e6b966e34fdd3799671d1/media/libcubeb/src/cubeb_winmm.c#l236
[4] https://crash-stats.mozilla.com/report/index/b06848a1-5d46-4c19-b7de-2942c0190319
[5] https://crash-stats.mozilla.com/report/index/46ffa3f2-8efa-4a30-88cf-fb2480190223
Comment 19•7 years ago
|
||
I wonder why we're using the WinMM backend on Windows 10 at all. That might indicate some problem with the audio hardware/drivers or OS, since we've already fallen back from the WASAPI backend. Possibly a machine with no audio hardware?
As far as winmm_refill_stream, it's normal for winmm_stream_init to call that as the buffers need to be queued before starting. WinMM signals our provided event once a buffer is free, which is what drives the winmm_buffer_thread to requeue buffers. It should've been done in _start really (and consistenly in all backends), but that's a bug in the design of libcubeb since the beginning.
I wonder if the failure case here is: no audio hardware available - causes WASAPI to fail to init, but WinMM chugs on until you try to play audio, at which point it never makes progress. With this crash, maybe that occurred and then something waiting on us timed out (just guessing) and got freed, then WinMM unblocks and we hit a UAF. I can test that theory locally, will report back.
Comment 20•7 years ago
|
||
(In reply to Matthew Gregan [:kinetik] from comment #19)
I wonder if the failure case here is: no audio hardware available - causes WASAPI to fail to init, but WinMM chugs on until you try to play audio, at which point it never makes progress. With this crash, maybe that occurred and then something waiting on us timed out (just guessing) and got freed, then WinMM unblocks and we hit a UAF. I can test that theory locally, will report back.
This doesn't seem to be the case, at least testing in a Windows 10 VM with no audio hardware (or with audio hardware attached but disabled via mmsys.cpl). The WASAPI backend fails to initialize due to IMMDeviceEnumerator::GetDefaultAudioEndpoint returning E_NOTFOUND. The WinMM backend then fails due to waveOutGetNumDevs() returning 0 - but even with that check removed, waveOutOpen fails with MMSYSERR_BADDEVICEID during stream initialization.
Comment 21•7 years ago
|
||
I think with comment #20 we have run out of ideas here for now. Marking as stalled.
Updated•6 years ago
|
Updated•3 years ago
|
Comment 22•3 years ago
|
||
Only 5 crashes in the last 6 months
Comment 23•3 years ago
|
||
Since the bug is closed, the stalled keyword is now meaningless.
For more information, please visit auto_nag documentation.
Updated•2 years ago
|
Description
•