Leak nsDocument, nsGlobalWindow with <audio>

RESOLVED FIXED

Status

()

RESOLVED FIXED
10 years ago
9 years ago

People

(Reporter: jruderman, Assigned: roc)

Tracking

(Blocks: 1 bug, {memory-leak, testcase})

Trunk
x86
Mac OS X
memory-leak, testcase
Points:
---
Bug Flags:
blocking1.9.2 +
wanted1.9.1.x ?
in-testsuite +

Firefox Tracking Flags

(status1.9.2 beta1-fixed)

Details

Attachments

(2 attachments)

(Reporter)

Description

10 years ago
Created attachment 378536 [details]
testcase

trace-refcnt reports a leak including nsDocument and nsGlobalWindow.
(Reporter)

Comment 1

10 years ago
This prevents me from looking for other nsGlobalWindows leaks while fuzzing.
Flags: blocking1.9.2?
This looks pretty bad.
(Reporter)

Comment 3

10 years ago
Still leaks on mozilla-central (the fix for bug 502055 didn't help).
I guess it's not that bad if it only happens for media elements with javascript: source URLs, which no-one would actually really use, but it's still bad.
Assignee: nobody → roc
Flags: blocking1.9.2? → blocking1.9.2+
The problem seems to be that the nsHTMLMediaElement::MediaLoadListener is not released. Maybe because the nsJSChannel is failing with this warning:
WARNING: No principal to execute JS with: file /Users/roc/mozilla-checkin/dom/src/jsurl/nsJSProtocolHandler.cpp, line 189
Created attachment 386933 [details] [diff] [review]
fix

The problem is the cycle where the MediaLoadListener holds a reference to the element, the element holds a reference to the channel, and the channel holds a reference to the MediaLoadListener. Normally we break that cycle in OnStartRequest by clearing mElement, but if there's an error status in OnStartRequest we're not clearing mElement.

This could be pretty bad, it could leak anytime we have an error in OnStartRequest.
Attachment #386933 - Flags: review?(chris)
Whiteboard: [needs review]
Attachment #386933 - Flags: review?(chris) → review+
Checked in:
http://hg.mozilla.org/mozilla-central/rev/6451086910d3
There was a stupid mistake that caused tests to crash. I fixed it:
http://hg.mozilla.org/mozilla-central/rev/531ad2164ce9
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [needs review]
I think we should probably take this on branch, it's a simple patch and the leak is probably going to hit real users.
Flags: wanted1.9.1.x?
Mass change: adding fixed1.9.2 keyword

(This bug was identified as a mozilla1.9.2 blocker which was fixed before the mozilla-1.9.2 repository was branched (August 13th, 2009) as per this query: http://is.gd/2ydcb - if this bug is not actually fixed on mozilla1.9.2, please remove the keyword. Apologies for the bugspam)
Keywords: fixed1.9.2
status1.9.2: --- → beta1-fixed
Keywords: fixed1.9.2
You need to log in before you can comment on or make changes to this bug.