Closed Bug 1185191 Opened 9 years ago Closed 7 years ago

Assertion failure: "Invalid AudioContextState transition" with navigation, BroadcastChannel

Categories

(Core :: Web Audio, defect, P4)

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jruderman, Unassigned)

References

Details

(Keywords: assertion, testcase)

Attachments

(2 files)

> Assertion failure: (mAudioContextState == AudioContextState::Suspended && aNewState == AudioContextState::Running) || (mAudioContextState == AudioContextState::Running && aNewState == AudioContextState::Suspended) || (mAudioContextState == AudioContextState::Running && aNewState == AudioContextState::Closed) || (mAudioContextState == AudioContextState::Suspended && aNewState == AudioContextState::Closed) || (mAudioContextState == aNewState) (Invalid AudioContextState transition), at dom/media/webaudio/AudioContext.cpp:800
Attached file unreliable testcase (deleted) —
In a fast debug build from treeherder, this testcase always hits the assertion. But with a slow local debug build, I have to hit the back button several times to trigger the assertion.
Attached file stack (deleted) —
What is happening here is that we are suspending the AudioContext because `nsGlobalWindow::SuspendTimeouts` is called. At this point, we switch from the `AudioCallbackDriver` to a `SystemClockDriver` because we don't need an audio thread anymore and we'll pause the graph anyways. Then sometime later before the audio channel is closed, and before the promise for `Suspend` is sent back to the content, `nsGlobalWindow::FreeInnerObjects` is called, which calls "Close" on the context. This goes down the usual route, and finds a `SystemClockDriver` that is not switching, with no audio tracks, so it's resolved immediately. This is not very important, and the solution is not trivial (at least I could not immediately find a trivial one), I'm tempted to just relax the assert. Maybe a good way would be to not pass down a promise for Resume/Suspend/Close called from Gecko itself ?
Priority: -- → P3
Mass change P3->P4 to align with new Mozilla triage process.
Priority: P3 → P4
No longer reproduces on trunk.
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: in-testsuite+
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: