possible memory leak in CompositorParent in SampleValue

RESOLVED FIXED in Firefox 21

Status

()

Core
Graphics
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: samuel.gallacier, Assigned: samuel.gallacier)

Tracking

Trunk
mozilla21
All
Android
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(blocking-b2g:tef+, firefox19 wontfix, firefox20 wontfix, firefox21 fixed, b2g18 fixed, b2g18-v1.0.0 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

4 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20130115 Firefox/20.0
Build ID: 20130115042018

Steps to reproduce:

Using css transform (translateX) of a <p> element (scrolling text)


Actual results:

In method SampleValue in CompositorParent.cpp (gfx/layers/ipc/), a InfallibleTArray<TransformFunction> object is constructed, and copied in a Animatable. The object seem never been destructed.
The code is like:

InfallibleTArray<TransformFunction>* functions = new InfallibleTArray<TransformFunction>();
functions->AppendElement(TransformMatrix(transform));
*aValue = *functions;

Perhaps it should be :
InfallibleTArray<TransformFunction> functions;
functions.AppendElement(TransformMatrix(transform));
*aValue = functions;
Not sure what this code is supposed to be doing but it does look like there's a memory leak. CC'ing :dzbarksy who added it and :roc who r+'d it.
Component: General → Graphics
OS: Windows 7 → Android
Product: Firefox for Android → Core
Hardware: x86_64 → All
Version: Firefox 18 → Trunk
Blocks: 783835
Yep, your suggestion seems correct.
Samuel, would you be willing to create a patch for review with your suggested change? There are instructions at https://developer.mozilla.org/en-US/docs/Developer_Guide/How_to_Submit_a_Patch (and specifically https://developer.mozilla.org/en-US/docs/Creating_a_patch_that_can_be_checked_in). If not let me know and I can do it.
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 4

4 years ago
Created attachment 704493 [details] [diff] [review]
Correction proposal patch
Comment on attachment 704493 [details] [diff] [review]
Correction proposal patch

Samuel, the patch should really include a commit message and your author info (name + email) as well.
Attachment #704493 - Flags: review?(dzbarsky)
(Assignee)

Comment 6

4 years ago
Created attachment 704556 [details] [diff] [review]
Correction proposal patch
Attachment #704493 - Attachment is obsolete: true
Attachment #704493 - Flags: review?(dzbarsky)
Comment on attachment 704556 [details] [diff] [review]
Correction proposal patch

Thanks! :)
Attachment #704556 - Flags: review?(dzbarsky)
Comment on attachment 704556 [details] [diff] [review]
Correction proposal patch

Looks good to me.  Make sure you put "r=dzbarsky" in your commit message.
Attachment #704556 - Flags: review?(dzbarsky) → review+
The person landing it can do that. Inbound is closed currently so marking as checkin-needed.
Keywords: checkin-needed
Landed on inbound:

https://hg.mozilla.org/integration/mozilla-inbound/rev/f92a3d2c1e5b
Assignee: nobody → samuel.gallacier
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/f92a3d2c1e5b
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
Should we consider uplift this to b2g18? Leaking a object for each animation composition seems pretty bad.
Sounds like a good idea to me. It's a simple enough patch.
blocking-b2g: --- → tef?
I spoke about this with kats via IRC and he re-iterated his thinking that this was low risk and worth the reward.
blocking-b2g: tef? → tef+
Keywords: checkin-needed
https://hg.mozilla.org/releases/mozilla-b2g18/rev/6fecf538bfcb
https://hg.mozilla.org/releases/mozilla-b2g18_v1_0_0/rev/7cb579ad7aed
status-b2g18: --- → fixed
status-firefox19: --- → wontfix
status-firefox20: --- → wontfix
status-firefox21: --- → fixed
Keywords: checkin-needed
Landed on mozilla-b2g18/gaia master prior to the 1/25 branching to mozilla-b2g18_v1_0_0/v1.0.0, updating status-b2g-v1.0.0 to fixed.
status-b2g18-v1.0.0: --- → fixed
scratch the previous comment - it got uplifted yesterday to the right branches - still fixed.

Updated

4 years ago
Blocks: 938334
You need to log in before you can comment on or make changes to this bug.