Closed
Bug 1422983
Opened 7 years ago
Closed 7 years ago
cycle collect ClientSource owner reference to nsGlobalWindowInner and nsDocShell
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla59
Tracking | Status | |
---|---|---|
thunderbird_esr52 | --- | unaffected |
firefox-esr52 | --- | unaffected |
firefox58 | --- | unaffected |
firefox59 | - | fixed |
People
(Reporter: bkelly, Assigned: bkelly)
References
Details
Attachments
(1 file, 1 obsolete file)
We are seeing some leaks on nightly lately. It occurs to me that the ClientSource code I integrated with nsGlobalWindowInner and nsDocShell could be contributing to the problem. There is a ref-cycle in play but we don't include it in the cycle collection because ClientSource is not ref-counted at the moment.
Assignee | ||
Updated•7 years ago
|
Summary: verify ClientSource does not break cycle collection for nsGlobalWindowInner and nsDocShell → cycle collect ClientSource owner reference to nsGlobalWindowInner and nsDocShell
Updated•7 years ago
|
status-firefox58:
--- → unaffected
status-firefox59:
--- → affected
status-firefox-esr52:
--- → unaffected
Comment 1•7 years ago
|
||
This could cause bad leaks and should be easy to fix.
tracking-firefox59:
--- → ?
Assignee | ||
Comment 2•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=a77744b88435fc0be682e4ffecabd636f2cf9a9b
Comment 3•7 years ago
|
||
Make sure to traverse/unlink this in every CCed thing that holds one of these. It looks like at least nsDocShell and nsGlobalWindowInner have one. LoadInfo has one but it isn't CCed. WorkerPrivate has one, and maybe it is CCed?
Assignee | ||
Comment 4•7 years ago
|
||
Comment on attachment 8934316 [details] [diff] [review] Cycle collect the ClientSource object when owned by an nsGlobalWindowInner or nsDocShell object. r=mccr8 Since this is a small patch I'm going to flag for review now even though try has not completed. Note, we only need to CC the ClientSource when its owned by the nsGlobalWindowInner and nsDocShell. These are the only cases where we have a strong ref out from ClientSource to a CC'able object. When the ClientSource is owned by a WorkerPrivate or LoadInfo object we do not have a strong reference out to the owner.
Attachment #8934316 -
Flags: review?(continuation)
Comment 5•7 years ago
|
||
Comment on attachment 8934316 [details] [diff] [review] Cycle collect the ClientSource object when owned by an nsGlobalWindowInner or nsDocShell object. r=mccr8 Review of attachment 8934316 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/clients/manager/ClientSource.cpp @@ +270,5 @@ > +{ > + if (mOwner.is<RefPtr<nsPIDOMWindowInner>>()) { > + ImplCycleCollectionTraverse(aCallback, > + mOwner.as<RefPtr<nsPIDOMWindowInner>>(), > + "mOwner", aFlags); You should use aName here instead of "mOwner", and in the other case. aName will be the name of the ClientSource field (for instance "mClientSource"). This is what the name of the field is going to show up as in the cycle collector log, for the window or docshell. If there was more than one thing here we wanted to traverse then it would get complicated but for now this will work. If you think that would be confusing, then maybe a field name like ClientSource::mOwner would work.
Attachment #8934316 -
Flags: review?(continuation) → review+
Assignee | ||
Comment 6•7 years ago
|
||
Attachment #8934316 -
Attachment is obsolete: true
Attachment #8934384 -
Flags: review+
Pushed by bkelly@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/46463dab3129 Cycle collect the ClientSource object when owned by an nsGlobalWindowInner or nsDocShell object. r=mccr8
Comment 8•7 years ago
|
||
Hmm, how good is the cycle collection stuff in nsDocShell. Didn't mystor make the globalwindow split in a bit different way because merging outer to nsDocShell was leaky. (I wonder why mInitialClientSource is in docshell and not in outer. Perhaps doesn't matter much.)
Comment 9•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/46463dab3129
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Updated•6 years ago
|
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•