Closed Bug 1403043 Opened 5 years ago Closed 5 years ago

AudioStream reenters libcubeb from within data_callback, resulting in potential deadlocks

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: kinetik, Assigned: kinetik)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

AudioStream::DataCallback directly calls cubeb_get_backend_id.  Instead, it should query the backend during stream construction and use a local flag to apply the winmm workaround.

While this happens to work with at least some of the current backends, it's not safe to do in general and the libcubeb API is not intended to be called reentrantly from within callbacks.


It'd be even better to fix (or have fixed) the winmm backend in the first place rather than applying ad hoc workarounds like this.
Attached patch bug1403043.patch (obsolete) — Splinter Review
Assignee: nobody → kinetik
Status: NEW → ASSIGNED
Attachment #8912473 - Flags: review?(jwwang)
Attached patch bug1403043.patchSplinter Review
Attachment #8912473 - Attachment is obsolete: true
Attachment #8912473 - Flags: review?(jwwang)
Attachment #8912478 - Flags: review?(jwwang)
Attachment #8912478 - Flags: review?(jwwang) → review+
Pushed by mgregan@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/7bdc00f1e687
Avoid reentering libcubeb from data_callback.  r=jwwang
https://hg.mozilla.org/mozilla-central/rev/7bdc00f1e687
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.