Closed Bug 1574284 Opened 8 months ago Closed 6 months ago

Crash in macOS AudioIPC when unplugging mic during a WebRTC call [@ cubeb_backend::capi::capi_stream_get_current_device]

Categories

(Core :: Audio/Video: MediaStreamGraph, defect, P2, critical)

Unspecified
macOS
defect

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox-esr60 --- unaffected
firefox-esr68 --- unaffected
firefox67 --- unaffected
firefox68 --- unaffected
firefox69 --- unaffected
firefox70 --- wontfix
firefox71 --- fixed

People

(Reporter: chunmin, Assigned: padenot)

References

(Blocks 1 open bug)

Details

(Keywords: crash)

Crash Data

Attachments

(1 file)

Step to reproduce

  1. Open about:config and set media.cubeb.sandbox to true
  2. Go to https://mozilla.github.io/webrtc-landing/gum_test.html and click Audio
  3. Select a microphone that can be unplugged (USB microphone, bluetooth headset, ... etc)
  4. After the call is started, unplug the microphone

Expected result

The microphone is switched to another device (if there is another microphone)

Actual result

Get a crash

Crash log

Hit MOZ_CRASH(assertion failed: `(left == right)`
  left: `true`,
 right: `false`) at media/audioipc/client/src/lib.rs:84
#01: gkrust_shared::panic_hook::h38fd71e185dee508[/Users/<username>/Work/gecko/obj-x86_64-apple-darwin18.5.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x6641958]
#02: core::ops::function::Fn::call::h1f718a637c76b5da[/Users/<username>/Work/gecko/obj-x86_64-apple-darwin18.5.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x663ee5c]
#03: std::panicking::rust_panic_with_hook::hddd286a9c773fc67[/Users/<username>/Work/gecko/obj-x86_64-apple-darwin18.5.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x7cdffb1]
#04: std::panicking::continue_panic_fmt::ha1bbafe7a6df805a[/Users/<username>/Work/gecko/obj-x86_64-apple-darwin18.5.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x7cdf9fd]
#05: std::panicking::begin_panic_fmt::hea7f0ae086528c10[/Users/<username>/Work/gecko/obj-x86_64-apple-darwin18.5.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x7cdf951]
#06: audioipc_client::assert_not_in_callback::_$u7b$$u7b$closure$u7d$$u7d$::h888e6b9e2c32ae64 (.llvm.2648616375446828804)[/Users/<username>/Work/gecko/obj-x86_64-apple-darwin18.5.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x6ad4e92]
#07: std::thread::local::LocalKey$LT$T$GT$::try_with::h80f82c0f885f93b1[/Users/<username>/Work/gecko/obj-x86_64-apple-darwin18.5.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x6ad3185]
#08: std::thread::local::LocalKey$LT$T$GT$::with::h974d8256753483fa[/Users/<username>/Work/gecko/obj-x86_64-apple-darwin18.5.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x6ad2cf9]
#09: _$LT$audioipc_client..stream..ClientStream$u20$as$u20$cubeb_backend..traits..StreamOps$GT$::current_device::he0bd32c96a3f0831[/Users/<username>/Work/gecko/obj-x86_64-apple-darwin18.5.0/dist/NightlyDebug.app/Contents/MacOS/XUL +0x6add10f]
Attached file crash stack in lldb

Here is the crash report. Here can find more.

It looks like the GraphDriver calls the current_device that is not allowed to be called in a callback.

Blocks: 1570145
Flags: needinfo?(kinetik)

Set the priority to P2 for now. Feel free to change it.

Priority: -- → P2

Re-entering the cubeb API from within a callback context is forbidden. The assert in AudioIPC enforces that - earlier in cubeb's history we didn't bother to enforce this and would end up with random bugs in various backends.

GraphDriver needs to the queue the panning change to run outside of callback context. That's probably the simplest/quickest fix. Paul was planning on removing panning from the cubeb API in https://github.com/kinetiknz/cubeb/issues/522, but I'm not sure when that'll happen.

Flags: needinfo?(kinetik)
Blocks: 1425788
Component: Audio/Video: cubeb → Audio/Video: MediaStreamGraph
Severity: normal → critical
Crash Signature: [@ cubeb_backend::capi::capi_stream_get_current_device]
Keywords: crash
Summary: Get a crash in AudioIPC when unplugging mic during a WebRTC call → Crash in macOS AudioIPC when unplugging mic during a WebRTC call [@ cubeb_backend::capi::capi_stream_get_current_device]
Version: unspecified → Trunk
Duplicate of this bug: 1570145
Depends on: 1575638

Fixed by bug 1575638.

Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Assignee: nobody → padenot
Target Milestone: --- → mozilla71
You need to log in before you can comment on or make changes to this bug.