Closed Bug 493915 Opened 16 years ago Closed 15 years ago

Leak nsDocument, nsGlobalWindow with <audio>

Categories

(Core :: Audio/Video, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
status1.9.2 --- beta1-fixed

People

(Reporter: jruderman, Assigned: roc)

References

Details

(Keywords: memory-leak, testcase)

Attachments

(2 files)

Attached file testcase (deleted) —
trace-refcnt reports a leak including nsDocument and nsGlobalWindow.
This prevents me from looking for other nsGlobalWindows leaks while fuzzing.
Flags: blocking1.9.2?
This looks pretty bad.
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
Attached patch fix (deleted) — Splinter Review
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
Closed: 15 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
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: