Closed Bug 955236 Opened 10 years ago Closed 10 years ago

Shutdown leak if there was an active IRC channel

Categories

(Chat Core :: IRC, defect)

x86
Other
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: florian, Assigned: florian)

References

Details

Attachments

(1 file, 1 obsolete file)

*** Original post on bio 1803 at 2012-11-17 23:38:00 UTC ***

*** Due to BzAPI limitations, the initial description is in comment 1 ***
Blocks: 953828
Attached patch Fix (obsolete) — Splinter Review
*** Original post on bio 1803 as attmnt 2094 at 2012-11-17 23:38:00 UTC ***

After poking around for a while, the cycle collector dump gave me this information:

$ python heapgraph/cc/find_roots.py cc-edges-5.73941.log XPCWrappedNative
Parsing cc-edges-5.73941.log. Done loading graph. Reversing graph. Done.

0x10d53ed10 [nsXPCWrappedJS (nsISupports)]
    --[mJSObj]-> 0x110130300 [JS Object (Object)]
    --[_chatRoomFields]-> 0x10f793700 [JS Object (XPCWrappedNative_NoHelper)]
    --[xpc_GetJSPrivate(obj)]-> 0x11925ce40 [XPCWrappedNative]

    Root 0x10d53ed10 is a ref counted object with 1 unknown edge(s).
    known edges:
       0x10d53ef90 [nsXPCWrappedJS (nsIClassInfo)] --[root]-> 0x10d53ed10
       0x10d53ed10 [nsXPCWrappedJS (nsISupports)] --[self]-> 0x10d53ed10

0x10d53ef90 [nsXPCWrappedJS (nsIClassInfo)]
    --[mJSObj]-> 0x10dd70280 [JS Object (Proxy)]
    --[private]-> 0x110130300 [JS Object (Object)]
    --[_chatRoomFields]-> 0x10f793700 [JS Object (XPCWrappedNative_NoHelper)]
    --[xpc_GetJSPrivate(obj)]-> 0x11925ce40 [XPCWrappedNative]

    Root 0x10d53ef90 is a ref counted object with 1 unknown edge(s).
    known edges:
       0x10d53ef90 [nsXPCWrappedJS (nsIClassInfo)] --[self]-> 0x10d53ef90



So we have for some reason _chatRoomFields that owns a reference to an xpconnect wrapper around the object that owns _chatRoomFields.

The trivial attached patch fixes the leak by breaking the cycle when the conversation is uninitialized.

I suspect it could be much nicer to unwrap aComponents in the joinChat method, to avoid creating the cycle.
Attachment #8353855 - Flags: review?(clokep)
Comment on attachment 8353855 [details] [diff] [review]
Fix

*** Original change on bio 1803 attmnt 2094 at 2012-11-18 05:20:11 UTC was without comment, so any subsequent comment numbers will be shifted ***
Attachment #8353855 - Flags: review?(clokep) → review+
*** Original post on bio 1803 as attmnt 2097 at 2012-11-18 10:08:00 UTC ***

This avoids creating the cycle. Chose your preferred patch :).
Attachment #8353858 - Flags: review?(clokep)
Assignee: nobody → florian
Comment on attachment 8353858 [details] [diff] [review]
Alternative patch

*** Original change on bio 1803 attmnt 2097 at 2012-11-18 14:01:45 UTC ***

Let's go with this one.
Attachment #8353858 - Flags: review?(clokep) → review+
*** Original post on bio 1803 at 2012-11-18 18:57:16 UTC ***

attachment 8353858 [details] [diff] [review] (bio-attmnt 2097) committed as http://hg.instantbird.org/instantbird/rev/39043e8937a5

Thanks.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.4
Comment on attachment 8353855 [details] [diff] [review]
Fix

*** Original change on bio 1803 attmnt 2094 at 2012-11-18 19:45:18 UTC ***

Marking this obsolete, as we didn't take it.
Attachment #8353855 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.