Closed Bug 1568372 Opened 6 years ago Closed 6 years ago

avoid racing calls to launch RDD process from multiple media playback threads

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: mjf, Assigned: mjf)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

I've seen this specifically when enabling vorbis decoding on RDD for Windows and running mochitest toolkit/content/tests. The watchdog crashes the process after we hang in RemoteDecoderManagerParent::ShutdownThreads[1]. The hang occurs because we have a RemoteDecoderManagerParent in the RDD process that will never be destroyed because it has no associated RemoteDecoderManagerChild and never gets the ActorDestroy call.

The race happens when the two media play back threads call RemoteDecoderModule::LaunchRDDProcessIfNeeded[2] at the same time. This results in a RemoteDecoderManagerChild in the content process pointing to the first RemoteDecoderManagerParent (created here[3]). The second time this code is called another RemoteDecoderManagerParent is created, but the eventual call to RemoteDecoderManagerChild::OpenForRDDProcess is basically ignored because we already have a functional RemoteDecoderManagerChild/Parent pair seen here[4].

Note, I found this during testing to enable Vorbis on RDD for Windows, but it could happen in other cases.

[1] https://searchfox.org/mozilla-central/source/dom/media/ipc/RemoteDecoderManagerParent.cpp#137-139
[2] https://searchfox.org/mozilla-central/source/dom/media/ipc/RemoteDecoderModule.cpp#60
[3] https://searchfox.org/mozilla-central/source/dom/ipc/ContentChild.cpp#1224
[4] https://searchfox.org/mozilla-central/source/dom/media/ipc/RemoteDecoderManagerChild.cpp#168-169

Assignee: nobody → mfroman
Blocks: RDD
Priority: -- → P2

This stops a potential race when multiple media playback threads attempt to
launch the RDD process and setup the IPC connections between
RemoteDecoderManager{Child|Parent} at the same time.

Attachment #9080210 - Attachment description: Bug 1568372 - add mutex in RemoteDecoderModule::LaunchRDDProcessIfNeeded. → Bug 1568372 - add mutex in RemoteDecoderModule::LaunchRDDProcessIfNeeded. r?jya!

Bugbug thinks this bug is a task, but please change it back in case of error.

Type: defect → task
Type: task → defect
Blocks: 1524049

(In reply to Release mgmt bot [:sylvestre / :calixte / :marco for bugbug] from comment #2)

Bugbug thinks this bug is a task, but please change it back in case of error.

This patch fixes a perma-orange when enabling vorbis decoding on RDD for Windows. It is a defect that is rare in the wild, but more common on try in certain situations (audio decoding), and very repeatable for vorbis/RDD/Win.

Pushed by mfroman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b1af44cb3a2c add mutex in RemoteDecoderModule::LaunchRDDProcessIfNeeded. r=jya
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: