Closed
Bug 910171
Opened 11 years ago
Closed 11 years ago
DelayNode in OfflineAudioContext can leak the world, when self reference is not released
Categories
(Core :: Web Audio, defect)
Tracking
()
RESOLVED
FIXED
mozilla27
People
(Reporter: karlt, Assigned: karlt)
References
Details
(Whiteboard: [blocking-webaudio+])
Attachments
(3 files)
(deleted),
text/html
|
Details | |
(deleted),
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
register tail references with the AudioContext so they can be removed when the rendering is complete
(deleted),
patch
|
ehsan.akhgari
:
review+
akeybl
:
approval-mozilla-aurora+
akeybl
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
First apply
diff --git a/content/media/webaudio/test/test_delayNode.html b/content/media/webaudio/test/test_delayNode.html
--- a/content/media/webaudio/test/test_delayNode.html
+++ b/content/media/webaudio/test/test_delayNode.html
@@ -62,7 +62,7 @@ var gTest = {
context.createDelay(1); // should not throw
// Delay the source stream by 2048 frames
- delay.delayTime.value = 2048 / context.sampleRate;
+ delay.delayTime.value = 0.9;
source.start(0);
return delay;
Then run
TEST_PATH=content/media/webaudio/test/ make -C obj mochitest-plain
Results:
WARNING: Leaking the RDF Service.: file /home/karl/moz/dev/rdf/build/nsRDFModule.cpp, line 165
WARNING: YOU ARE LEAKING THE WORLD (at least one JSRuntime and everything alive inside it, that is) AT JS_ShutDown TIME. FIX THIS!
I think this is the same issue as bug 872635 was trying to address, but I
don't think anything knows how often DelayNodeEngine::ProduceAudioBlock()
needs to be called.
I'm not clear why this isn't an issue with non-offline contexts.
Assignee | ||
Comment 1•11 years ago
|
||
Spoke with roc about this.
With a non-offline AudioContext, ProduceAudioBlock() should be getting called for as long as the stream is in the graph, even if it has no input or output.
For OfflineAudioContext, when rendering is completed, we need to tell each node that has a self reference to drop that.
I assume there exists something similar for source nodes and we just need to extend that to include nodes that produce output after their inputs are disconnected.
Assignee: nobody → karlt
Comment 2•11 years ago
|
||
(In reply to comment #1)
> Spoke with roc about this.
>
> With a non-offline AudioContext, ProduceAudioBlock() should be getting called
> for as long as the stream is in the graph, even if it has no input or output.
>
> For OfflineAudioContext, when rendering is completed, we need to tell each node
> that has a self reference to drop that.
Yeah, that's right.
> I assume there exists something similar for source nodes and we just need to
> extend that to include nodes that produce output after their inputs are
> disconnected.
Actually I think we may have this bug for all self-references. :/
Assignee | ||
Comment 3•11 years ago
|
||
Source node self references are released in AudioContext::Shutdown().
We need to call that when offline rendering has completed, which is done in bug 914030 comment 6.
Bug 914033 is another situation where offline AudioContexts are not releasing source self references.
Assignee | ||
Comment 4•11 years ago
|
||
(In reply to Karl Tomlinson (:karlt) from comment #1)
> With a non-offline AudioContext, ProduceAudioBlock() should be getting
> called for as long as the stream is in the graph, even if it has no input or
> output.
That's true as long the browser keeps running to expire the delay.
If the browser shuts down before the delay expires, then there is a shutdown leak, which appears to be harmless.
To reproduce, open testcase, then close browser before the beep sounds at 60s.
Assignee | ||
Comment 5•11 years ago
|
||
Rather than having different hashtables for each kind of node that might want to keep a self reference, this adds a generic means to track all such nodes.
The intention is to switch existing playing reference code to use this in bug 914033.
Attachment #805095 -
Flags: review?(ehsan)
Assignee | ||
Updated•11 years ago
|
Blocks: 914033
Whiteboard: [blocking-webaudio?] → [blocking-webaudio+]
Assignee | ||
Comment 6•11 years ago
|
||
Attachment #805096 -
Flags: review?(ehsan)
Assignee | ||
Comment 7•11 years ago
|
||
Updated•11 years ago
|
Attachment #805095 -
Flags: review?(ehsan) → review+
Updated•11 years ago
|
Attachment #805096 -
Flags: review?(ehsan) → review+
Assignee | ||
Comment 8•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/efdd34cc38af
https://hg.mozilla.org/integration/mozilla-inbound/rev/81d850fca7b0
Flags: in-testsuite+
Comment 9•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/efdd34cc38af
https://hg.mozilla.org/mozilla-central/rev/81d850fca7b0
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
Assignee | ||
Comment 10•11 years ago
|
||
Comment on attachment 805096 [details] [diff] [review]
register tail references with the AudioContext so they can be removed when the rendering is complete
[Approval Request Comment]
Please consider this a request for both patches in this bug.
Bug caused by (feature/regressing bug #): webaudio
User impact if declined: some uses of OfflineAudioContexts will leak JSRuntimes for the lifetime of the browser/application.
Testing completed (on m-c, etc.): on m-c, in testsuite
Risk to taking this patch (and alternatives if risky): low, limited to webaudio
String or IDL/UUID changes made by this patch: none
Attachment #805096 -
Flags: approval-mozilla-beta?
Attachment #805096 -
Flags: approval-mozilla-aurora?
Updated•11 years ago
|
status-firefox24:
--- → unaffected
status-firefox25:
--- → affected
status-firefox26:
--- → affected
status-firefox27:
--- → fixed
tracking-firefox25:
--- → +
tracking-firefox26:
--- → +
tracking-firefox27:
--- → +
Updated•11 years ago
|
Attachment #805096 -
Flags: approval-mozilla-beta?
Attachment #805096 -
Flags: approval-mozilla-beta+
Attachment #805096 -
Flags: approval-mozilla-aurora?
Attachment #805096 -
Flags: approval-mozilla-aurora+
Comment 11•11 years ago
|
||
Comment 12•11 years ago
|
||
I landed this follow-up patch on Aurora because you need to call Init() to initialize hashtables there:
https://hg.mozilla.org/releases/mozilla-beta/rev/8b54e8872194
Assignee | ||
Comment 13•11 years ago
|
||
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #12)
> https://hg.mozilla.org/releases/mozilla-beta/rev/8b54e8872194
Looks good, thanks Ehsan!
Assignee | ||
Comment 14•11 years ago
|
||
The Aurora landings are actually these revisions:
https://hg.mozilla.org/releases/mozilla-aurora/rev/2350d1dd1133
https://hg.mozilla.org/releases/mozilla-aurora/rev/c9cd3bec15fe
Thanks, Ryan!
(Aurora does not need to Init() hashtables, only Beta.)
You need to log in
before you can comment on or make changes to this bug.
Description
•