Closed Bug 542437 Opened 14 years ago Closed 14 years ago

Leak nsGlobalWindow with onunload, <video> in <title>

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- -
status2.0 --- wanted

People

(Reporter: jruderman, Assigned: roc)

References

Details

(Keywords: memory-leak, testcase)

Attachments

(1 file)

Attached file testcase
Dunno if this is related to bug 503989.
I noticed this because it can entrain nsDocShell.
Assignee: nobody → roc
blocking2.0: --- → ?
Must be a cycle somewhere. I don't see where though.
Given that this is something that sites are very unlikely to intentionally run into, I won't be blocking the release on fixing this leak.
blocking2.0: ? → -
status2.0: --- → wanted
jst, I think roc nominated this bug based on it making it hard to look for *other* leak bugs, not based on the worry that users would hit this one.
The main thing I'm concerned about is that this leak might be a deeper problem and not just media-related.
I've tracked it down to nsDocument::DoNotifyPossibleTitleChange being called after nsDocument::Destroy has been called on that document. That calls NS_GetContentList which puts a list in gCachedContentList *after* nsContentList::OnDocumentDestroy has been called on the document, so the list hangs around in gCachedContentList indefinitely, causing the leak.

nsBaseContentList::Shutdown would release gCachedContentList, but that never runs because nsLayoutStatics::Shutdown only runs if all nsGlobalWindows are released, and a window has been entrained somehow. I'm not sure how, though.
I can easily work around it by having nsDocument::DoNotifyPossibleTitleChange return early if mIsGoingAway, but that doesn't seem like quite the right fix. For one thing, there might be other code that creates a content list for the document. Or we might create a content list for a document that's never belonged to a viewer and won't have nsDocument::Destroy called.

We need to do something about gCachedContentList... perhaps the right thing to do is to actually store one cached list per document and traverse it in cycle collection?
There is an existing bug about gCachedContentList, bug 523083.
Peterv wanted some other approach to that bug though.
Depends on: 523083
Right. The patch I prepared for this bug is a lot like your patch in bug 523083.
Whiteboard: [depends on 523083]
Fixed by checkin for bug 523083.
Status: NEW → RESOLVED
Closed: 14 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Whiteboard: [depends on 523083]
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: