Closed Bug 1763630 Opened 2 years ago Closed 2 years ago

Crash in [@ mozilla::AudioProcessingTrack::DisconnectDeviceInput]

Categories

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

Unspecified
All
defect

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox99 --- wontfix
firefox100 --- fixed
firefox101 --- fixed

People

(Reporter: aryx, Assigned: chunmin)

References

(Regression)

Details

(Keywords: crash, regression)

Crash Data

Attachments

(1 file)

~180 crashes for Firefox 98.0.x, 11 for 99.0 so far

Crash report: https://crash-stats.mozilla.org/report/index/f06b43d9-2b74-4a08-a05e-4f3770220407

Reason: EXCEPTION_ACCESS_VIOLATION_READ

Top 10 frames of crashing thread:

0 xul.dll mozilla::AudioProcessingTrack::DisconnectDeviceInput dom/media/webrtc/MediaEngineWebRTCAudio.cpp:1358
1 xul.dll mozilla::AudioProcessingTrack::Destroy dom/media/webrtc/MediaEngineWebRTCAudio.cpp:1172
2 xul.dll mozilla::DeviceListener::Stop dom/media/MediaManager.cpp:3967
3 xul.dll mozilla::LocalTrackSource::Stop dom/media/MediaManager.cpp:764
4 xul.dll mozilla::dom::MediaStreamTrackSource::UnregisterSink dom/media/MediaStreamTrack.h:232
5 xul.dll mozilla::dom::MediaStreamTrack::SetReadyState dom/media/MediaStreamTrack.cpp:546
6 xul.dll mozilla::dom::AudioStreamTrack::SetReadyState dom/media/AudioStreamTrack.cpp:69
7 xul.dll mozilla::dom::MediaStreamTrack::Stop dom/media/MediaStreamTrack.cpp:309
8 xul.dll mozilla::dom::MediaStreamTrack_Binding::stop dom/bindings/MediaStreamTrackBinding.cpp:3598
9 xul.dll mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::NormalThisPolicy, mozilla::dom::binding_detail::ThrowExceptions> dom/bindings/BindingUtils.cpp:3307
Flags: needinfo?(cchang)

Ah, MediaInputPort::GetSource() is graph-thread only but AudioProcessingTrack::DisconnectDeviceInput() calls it on main thread. I'll fix this next week.

Assignee: nobody → cchang
Status: NEW → ASSIGNED
Flags: needinfo?(cchang)
Has Regression Range: --- → yes

We should keep a main-thread only NativeInputTrack member variable in
AudioProcessingTrack and use it to connect and disconnect the device
input which open and close audio microphone in MTG.

See Also: → 1764186

When investigating this issue, I find we should make MediaInputPort::Get{Source, Destination} grapoh thread only, so I filed bug 1764186.

Blocks: 1238038

(In reply to C.M.Chang[:chunmin] from comment #1)
Another possible cause is that we allocate an empty MediaInputPort since the port is allocated after the AudioProcessingTrack has been destroyed. In that case, we will still allocate a NativeInputTrack but we didn't deallocate it due to the crash. The code in D143412 should be able to resolve this as well, if it's the cause.

Pushed by cchang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/094c8649451f
Connect device input via a main-thread only NativeInputTrack r=padenot
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch

The patch landed in nightly and beta is affected.
:chunmin, is this bug important enough to require an uplift?
If not please set status_beta to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(cchang)

Comment on attachment 9271799 [details]
Bug 1763630 - Connect device input via a main-thread only NativeInputTrack

Beta/Release Uplift Approval Request

  • User impact if declined: Firefox may cause crashes
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The patch simply saves a value and uses the value when it needs.
  • String changes made/needed:
Flags: needinfo?(cchang)
Attachment #9271799 - Flags: approval-mozilla-beta?

Comment on attachment 9271799 [details]
Bug 1763630 - Connect device input via a main-thread only NativeInputTrack

Approved for 100.0b8

Attachment #9271799 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: