Open Bug 339784 Opened 19 years ago Updated 3 years ago

In <mailWindow.js>, |nsMsgStatusFeedback.prototype| leaks when Seach Messages window is closed, as reported by Leak Monitor extension

Categories

(MailNews Core :: Search, defect)

defect

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: aha, Assigned: aceman)

References

(Blocks 1 open bug, )

Details

(Keywords: memory-leak)

Attachments

(1 file, 1 obsolete file)

2006052401/1.8-branch/SeaMonkey1.1a with Leak Monitor 2.0 (SM port) Repro: 1. select any folder with messages 2. open Search Messages window (Ctrl+Shift+S) 3. enter for example "s" into search dialog 4. hit search 5. close Search Messages window Actual: [+] [leaked object] (8e96130) = [object Object] [ ] statusTextFld (8d8c258) = [object XULElement] [ ] statusBar (8f438d8) = [object XULElement] [ ] statusPanel (8d8c250) = [object XULElement] [ ] throbber = null [ ] stopCmd = null [ ] meteorsSpinning = false [ ] startTimeoutID = null [ ] myDefaultStatus = [ ] stopTimeoutID = null [ ] [leaked object] (8f43b08) = [object Object]
Could you try a current Trunk build (too) ?
(In reply to comment #1) > Could you try a current Trunk build (too) ? I can confirm this with latest trunk. Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060530 SeaMonkey/1.5a
[Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8.1a2) Gecko/20060518 SeaMonkey/1.1a] (nightly) (W98SE) (Confirmed, on branch.) This happens at each closing. Simpler steps: *At step 1: you can be on a folder, or on an account. *Step 3 is optional, step 4 is enough (searching for blank, getting no result). For the record, simply opening and closing the Search window gives me the following report: [ ] [leaked object] (2603a60) = [object Object] [ ] [leaked object] (16b5118) = [object Object]
Severity: normal → major
Status: UNCONFIRMED → NEW
Ever confirmed: true
Target Milestone: --- → mozilla1.8.1beta1
Version: 1.8 Branch → Trunk
<http://landfill.bugzilla.org/mxr-test/seamonkey/search?string=nsMsgStatusFeedback&find=.*js> [[ nsMsgStatusFeedback /mailnews/base/search/resources/content/SearchDialog.js, line 56 -- var gStatusFeedback = new nsMsgStatusFeedback(); /mailnews/base/resources/content/subscribe.js, line 11 -- var gStatusFeedback = new nsMsgStatusFeedback; /mailnews/base/resources/content/mailWindow.js, line 146 -- window.MsgStatusFeedback = new nsMsgStatusFeedback(); /mailnews/base/resources/content/mailWindow.js, line 315 -- function nsMsgStatusFeedback() /mailnews/base/resources/content/mailWindow.js, line 319 -- nsMsgStatusFeedback.prototype = /mail/base/content/subscribe.js, line 11 -- var gStatusFeedback = new nsMsgStatusFeedback; /mail/base/content/mailWindow.js, line 151 -- window.MsgStatusFeedback = new nsMsgStatusFeedback(); /mail/base/content/mailWindow.js, line 274 -- function nsMsgStatusFeedback() /mail/base/content/mailWindow.js, line 278 -- nsMsgStatusFeedback.prototype = ]]
Summary: memory leak after closing Seach Messages window → In <mailWindow.js>, |nsMsgStatusFeedback.prototype| leaks each time a Seach Messages window is closed, as reported by Leak Detector Extension
Attached patch (Av1) <SearchDialog.js> (obsolete) — Splinter Review
[Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8.1a2) Gecko/20060524 SeaMonkey/1.1a] (nightly) (W98SE) This fixes the "detailed" object (leak).
Assignee: nobody → gautheri
Status: NEW → ASSIGNED
Attachment #223999 - Flags: review?(iann_bugzilla)
The following test shows where the "undetailed" object leak comes from: [[ function setupDatasource() { RDF = Components.classes[rdfServiceContractID].getService(Components.interfaces.nsIRDFService); gSearchView = Components.classes["@mozilla.org/messenger/msgdbview;1?type=search"].createInstance(Components.interfaces.nsIMsgDBView); var count = new Object; var cmdupdator = new nsMsgSearchCommandUpdater(); // gSearchView.init(messenger, msgWindow, cmdupdator); gSearchView.init(messenger, msgWindow, null); ]] but I don't know how to release (properly) this |cmdupdator|: helpwanted. (Call |.init()| again in the |function searchOnUnload()| ??)
Keywords: helpwanted
Forgot to say: the comment 0 and comment 3 leaks are the same; actually doing a search simply gives details on one of the two objects.
[Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8.1a3) Gecko/20060603 SeaMonkey/1.1a] (nightly) (W98SE) (Bug still there, with L.M. v0.3.0.)
Summary: In <mailWindow.js>, |nsMsgStatusFeedback.prototype| leaks each time a Seach Messages window is closed, as reported by Leak Detector Extension → In <mailWindow.js>, |nsMsgStatusFeedback.prototype| leaks each time a Seach Messages window is closed, as reported by Leak Monitor extension
Comment on attachment 223999 [details] [diff] [review] (Av1) <SearchDialog.js> Sorry, I do not know this part of the code, perhaps bienvenu or neil@parkwaycc ?
Attachment #223999 - Flags: review?(iann_bugzilla)
Serge, does this still apply? Neil, are you OK to review?
Severity: major → normal
Does this leak on trunk? Is it only this nsMsgStatusFeedback that leaks? (Other windows also use nsMsgStatusFeedback.)
(In reply to comment #11) > Does this leak on trunk? Is it only this nsMsgStatusFeedback that leaks? > (Other windows also use nsMsgStatusFeedback.) > Having just been looking at some items not too far from this this afternoon, I wouldn't be surprised if this does leak. I would expect the correct fix would be to call msgWindow.closeWindow (like mailWindow.js does) - which would automatically drop the nsMsgStatusFeedback - but I'm not sure if that is entirely the right fix in this case.
Product: Core → MailNews Core
What needs to be done here? Is this still valid?
OS: Windows XP → All
Hardware: x86 → All
Target Milestone: mozilla1.8.1beta1 → ---
Comment on attachment 223999 [details] [diff] [review] (Av1) <SearchDialog.js> > // release this early because msgWindow holds a weak reference > msgWindow.rootDocShell = null; >+ >+ // Unhook instanciated prototype. >+ msgWindow.statusFeedback = null; As per comment #12 we should use msgWindow.closeWindow(); instead (which also conveniently clears rootDocShell as well).
(In reply to :aceman from comment #13) > What needs to be done here? Is this still valid? Give me some time to get back to this bug...
Ok, I assume you take this to finish it.
Severity: normal → minor
Summary: In <mailWindow.js>, |nsMsgStatusFeedback.prototype| leaks each time a Seach Messages window is closed, as reported by Leak Monitor extension → In <mailWindow.js>, |nsMsgStatusFeedback.prototype| leaks when Seach Messages window is closed, as reported by Leak Monitor extension
(In reply to :aceman from comment #17) > Ok, I assume you take this to finish it. not so far :)
Whiteboard: [patchlove:jsf]
Target Milestone: Thunderbird 13.0 → ---
Whiteboard: [patchlove:jsf] → [patchlove:js]
Attached patch patch v2Splinter Review
Patch incorporating the suggestions.
Attachment #223999 - Attachment is obsolete: true
Attachment #8696244 - Flags: review?(neil)
Attachment #8696244 - Flags: review?(neil) → review?(mkmelin+mozilla)
Thanks for taking this over, aceman :-)
Assignee: bugzillamozillaorg_serge_20140323 → acelists
Whiteboard: [patchlove:js]
Comment on attachment 8696244 [details] [diff] [review] patch v2 Review of attachment 8696244 [details] [diff] [review]: ----------------------------------------------------------------- f+ : this looks like exactly what was suggested in previous comments.
Attachment #8696244 - Flags: feedback+
Comment on attachment 8696244 [details] [diff] [review] patch v2 Review of attachment 8696244 [details] [diff] [review]: ----------------------------------------------------------------- Looks reasonable. Did you verify it removes the leak?
Attachment #8696244 - Flags: review?(mkmelin+mozilla) → review+
No, I couldn't get the addon to work in TB. While I forced to to install, it can't load its binary component (on Linux). Maybe that one needs recompiling for current releases. The homepage http://dbaron.org/mozilla/leak-monitor/ seems to imply it no longer works.
Severity: minor → S4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: