Media Recording - memory leak when record a media stream without any tracks

VERIFIED FIXED in mozilla27

Status

()

Core
Audio/Video: Recording
VERIFIED FIXED
4 years ago
4 years ago

People

(Reporter: Jesse Ruderman, Assigned: rlin)

Tracking

(Blocks: 1 bug, {mlk, testcase})

Trunk
mozilla27
x86_64
Mac OS X
mlk, testcase
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(blocking-b2g:-)

Details

Attachments

(3 attachments, 2 obsolete attachments)

(Reporter)

Description

4 years ago
Created attachment 808026 [details]
testcase

1. Run a debug build with XPCOM_MEM_LEAK_LOG=2
2. Load the testcase
3. Quit

Result: trace-refcnt reports leaked MediaStream and other objects.
(Reporter)

Comment 1

4 years ago
Created attachment 808027 [details]
what leaked?
Assignee: nobody → rlin

Updated

4 years ago
Blocks: 896935
The Media Recorder get the media stream object without tracks and enter recording state.
I will fix it.
FWIW - this is good candidate to get a mochitest with btw. You could just create a test that models the exact test case included with an additional check that the InvalidStateError fires when calling start a 2nd time.
I will let media recorder throw the InvalidStateError exception when we got this kind of source.
BTW, correct the comment 2, now it failed on principal check (no source can be checked) and throw security error without destroy the TrackUnionStream object, this unclear message would confuse UA.
Summary: MediaRecorder leak → Media Recording - memory leak when record a media stream without any tracks
Created attachment 809795 [details] [diff] [review]
patch v1

patch for this bug, also include the test case.
Attachment #809795 - Flags: review?(roc)
Attachment #809795 - Flags: review?(jsmith)
Comment on attachment 809795 [details] [diff] [review]
patch v1

Review of attachment 809795 [details] [diff] [review]:
-----------------------------------------------------------------

review+ with nits

::: content/media/test/test_mediarecorder_record_nosrc.html
@@ +5,5 @@
> +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
> +  <script type="text/javascript" src="manifest.js"></script>
> +</head>
> +<body>
> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=897776">Mozill

Nit - the href link should point to bug 919051

@@ +14,5 @@
> +function startTest() {
> +  var mediastream = document.createElement('video').mozCaptureStream();
> +
> +  var mr = new MediaRecorder(mediastream);
> +  ok(true, 'create MediaRecorder');

Nit - I would make this an info statement
Attachment #809795 - Flags: review?(jsmith) → review+
Attachment #809795 - Flags: review?(roc) → review+
Created attachment 811036 [details] [diff] [review]
check-in patch

Check in patch, carry reviewer, merge with today's mc change.
try result
https://tbpl.mozilla.org/?tree=Try&rev=13fbf4296439
Created attachment 811037 [details] [diff] [review]
check-in patch

this one, remove two useless header include.
Attachment #811036 - Attachment is obsolete: true
Keywords: checkin-needed
Attachment #809795 - Attachment is obsolete: true
https://hg.mozilla.org/integration/b2g-inbound/rev/021e1b5e8cab
Flags: in-testsuite+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/021e1b5e8cab
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
Verified through successful landing of mochitest.
Status: RESOLVED → VERIFIED
bug 924724, which is koi+, depends on the change here. Need to uplift this patch
blocking-b2g: --- → koi?
(In reply to C.J. Ku[:CJKu] from comment #12)
> bug 924724, which is koi+, depends on the change here. Need to uplift this
> patch

That shouldn't influence if this bug is a blocker or not. What you need to do on bug 924724 is build a branch-specific patch to fix the issue independent of this bug.

I don't think this bug is a blocker either - it's not a likely use case a developer will do & memory leak impact isn't critical.
blocking-b2g: koi? → -
If the branch-specific patch ends up being "roll these changes into that patch", it would be preferable to just land these changes under this bug number. Also, we have a lot of historical precedent for "blocks a blocker" approvals.
Component: Video/Audio → Video/Audio: Recording

Updated

4 years ago
No longer blocks: 896935
You need to log in before you can comment on or make changes to this bug.