Closed Bug 863918 Opened 7 years ago Closed 6 years ago

Leak with many AudioContexts

Categories

(Core :: Web Audio, defect)

x86_64
macOS
defect
Not set

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jruderman, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: memory-leak, testcase)

Attachments

(2 files)

Attached file testcase
1. Run debug Firefox with XPCOM_MEM_LEAK_LOG=2
2. Load the testcase
3. Quit

Result: trace-refcnt reports leak of AudioNodeEngine, AudioNodeStream, MediaStream, StreamBuffer, TimeVaryingBase, nsTArray_base

Also, it takes a while to shut down (bug 821062?).
Attached file what leaked?
The long pause is caused by many calls to cubeb_stream_stop, once for each AudioDestinationNode.

So, MediaStreamGraphImpl::AppendMessage contains special logic to handle messages dispatched during shutdown.  Is there anything which can happen asynchronously which would cause some of the streams to not be deleted?
Blocks: webaudio
Also note that the leak is intermittent.
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #2)
> So, MediaStreamGraphImpl::AppendMessage contains special logic to handle
> messages dispatched during shutdown.  Is there anything which can happen
> asynchronously which would cause some of the streams to not be deleted?

It sounds like there's a bug in that logic. I don't know what the bug is.
Mass moving Web Audio bugs to the Web Audio component.  Filter on duckityduck.
Component: Video/Audio → Web Audio
Jesse, do you still see this bug?
Flags: needinfo?(jruderman)
Shutdown takes about 10 seconds, but the leak is gone.
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(jruderman)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.