leaks of Observer service through cycles

RESOLVED FIXED in Future

Status

SeaMonkey
UI Design
P3
normal
RESOLVED FIXED
15 years ago
13 years ago

People

(Reporter: dbaron, Assigned: dbaron)

Tracking

({mlk})

Trunk
Future
x86
Linux

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [patch])

Attachments

(2 attachments, 2 obsolete attachments)

(Assignee)

Description

15 years ago
In my build I'm seeing some leaks of the observer service and some corresponding
XPConnect wrappers (going both ways) through cycles where observers implemented
in JS have some path to the observer service (which prevents the observer
service's wrapper from being GCed), and the observer service then in turn owns
the observers (through an nsSupportsArray).

I'm not sure why these leaks don't show up on tinderbox.  There were two GC
paths I fixed:

08370748 object 0x83a9c40 XPCWrappedNative_NoHelper via
nsXPCWrappedJS::mJSObj(Function).__parent__(ChromeWindow).observerService(XPCWrappedNative_NoHelper).
I fixed with the changes to cookieTasksOverlay.xul

086b4958 object 0x86c3970 XPCWrappedNative_NoHelper via
nsXPCWrappedJS::mJSObj(Object).observe(Function).__parent__(Call).service(XPCWrappedNative_NoHelper).
I fixed with changes to navigator.js

There are a bunch of other places that look suspicious but that probably didn't
get executed:
http://lxr.mozilla.org/seamonkey/source/extensions/cookie/resources/content/cookieTasksOverlay.xul#100
http://lxr.mozilla.org/seamonkey/source/xpfe/components/prefwindow/resources/content/pref-charset.xul#37
http://lxr.mozilla.org/seamonkey/source/xpfe/components/prefwindow/resources/content/pref-languages.xul#35
http://lxr.mozilla.org/seamonkey/source/mailnews/base/prefs/resources/content/pref-viewing_messages.xul#15
http://lxr.mozilla.org/seamonkey/source/mailnews/base/resources/content/folderProps.xul#41
http://lxr.mozilla.org/seamonkey/source/mailnews/compose/prefs/resources/content/pref-composing_messages.xul#14
(Assignee)

Comment 1

15 years ago
Created attachment 100072 [details] [diff] [review]
patch (diff -u)
(Assignee)

Comment 2

15 years ago
Created attachment 100073 [details] [diff] [review]
patch (diff -uw)
(Assignee)

Updated

15 years ago
Status: NEW → ASSIGNED
Keywords: mlk
Priority: -- → P3
Whiteboard: [patch]
Target Milestone: --- → Future
(Assignee)

Comment 3

15 years ago
Brendan pointed out that an alternative (and preferred) solution for the closure
cycle is to either null out the service variable or not use a variable at all
(since it's only used once).
... so service would have to be changed from const to var if it were kept.

The cookie patch looks like it just avoids unnecessary global variables, which
can entrain lots of garbage too.

/be
(Assignee)

Comment 5

15 years ago
Created attachment 102720 [details] [diff] [review]
revised patch (diff -u)
Attachment #100072 - Attachment is obsolete: true
(Assignee)

Comment 6

15 years ago
Created attachment 102721 [details] [diff] [review]
revised patch (diff -uw)
Attachment #100073 - Attachment is obsolete: true

Comment 7

15 years ago
Comment on attachment 102721 [details] [diff] [review]
revised patch (diff -uw)

r=morse
Attachment #102721 - Flags: review+

Comment 8

15 years ago
Comment on attachment 102721 [details] [diff] [review]
revised patch (diff -uw)

sr=jag
Attachment #102721 - Flags: superreview+
(Assignee)

Comment 9

15 years ago
Fix checked in to trunk, 2002-11-06 04:54/55 PDT.
Status: ASSIGNED → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
Product: Core → Mozilla Application Suite
You need to log in before you can comment on or make changes to this bug.