Closed
Bug 433231
Opened 17 years ago
Closed 16 years ago
Places Library leaks the nsGlobalWindow when closed with a history entry selected
Categories
(Firefox :: Bookmarks & History, defect)
Tracking
()
VERIFIED
FIXED
Firefox 3.6a1
People
(Reporter: asqueella, Assigned: mak)
References
Details
(Keywords: memory-leak, verified1.9.1)
Attachments
(2 files, 4 obsolete files)
3.59 KB,
patch
|
dietrich
:
review+
beltzner
:
approval1.9.1+
|
Details | Diff | Splinter Review |
5.55 KB,
patch
|
sdwilsh
:
review+
|
Details | Diff | Splinter Review |
1. Open the Places Library
2. Click History
3. Click a history entry
4. Quit Firefox
-> the organizer window is leaked
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9pre) Gecko/2008051011 Minefield/3.0pre
This is due to a mistake in the code that handles adding/removing a bookmarks service observer, "this._itemId" in the code the attached patch changes can be != -1 when the observer is added and == -1 in the unload event handler.
I'm not really familiar with this code and haven't run the unit tests (since http://developer.mozilla.org/en/docs/Mozilla_automated_testing doesn't have the step-by-step instructions and I don't have the time to figure it out). Would appreciate if someone could test the change and get this in for 1.9+.
Attachment #320425 -
Flags: review?(sayrer)
Flags: wanted1.9.0.x?
Updated•17 years ago
|
Attachment #320425 -
Flags: review?(sayrer) → review?(mano)
Comment 1•16 years ago
|
||
Mano, can you review this?
Assignee: nobody → asqueella
Flags: wanted1.9.0.x? → wanted1.9.0.x+
Reporter | ||
Comment 2•16 years ago
|
||
This is a trivial change, seems that it still applies. Marco, are you interested in helping to get it in?
Updated•16 years ago
|
Attachment #320425 -
Flags: review?(mano) → review?(mak77)
Comment 3•16 years ago
|
||
hm, some of the bookmark observer methods seem to assume id > 0, might need updating.
Assignee | ||
Comment 4•16 years ago
|
||
From what i can see, the panel has been created for a one-shot use, so it has to be inited for a certain item, and be uninited after editing has finished. So this to me appear more like an issue in the organizer rather than in editBookmarkOverlay. I think setting and unsetting the bookmarks observer always (for bookmarks and history items) is not correct, moreover in uninit we make other cleanups that could be lost and cause leaks (microsummaries anyone?).
Finally, imo, the correct fix is to uninit the panel in _fillDetailsPane (places.js) before initing it again. This should solve the fact we could start the panel with a certain itemId and uninit it with another one.
What do you think about this?
Assignee | ||
Updated•16 years ago
|
Attachment #320425 -
Flags: review?(mak77) → review-
Assignee | ||
Comment 5•16 years ago
|
||
Comment on attachment 320425 [details] [diff] [review]
patch
mh, for the above reasoning i think this is not the way to go, but feel free to provide further reasons if i'm wrong.
Assignee | ||
Updated•16 years ago
|
Attachment #355760 -
Flags: review?(dietrich)
Comment 6•16 years ago
|
||
(In reply to comment #4)
> Created an attachment (id=355760) [details]
> patch v2
>
> From what i can see, the panel has been created for a one-shot use, so it has
> to be inited for a certain item, and be uninited after editing has finished. So
> this to me appear more like an issue in the organizer rather than in
> editBookmarkOverlay. I think setting and unsetting the bookmarks observer
> always (for bookmarks and history items) is not correct, moreover in uninit we
> make other cleanups that could be lost and cause leaks (microsummaries
> anyone?).
the code that Nickolay pointed out seems fragile as-is, should be more robust wrt to misuse by callers. should be able to resolve that w/o adding the bookmark observer for history items.
agreed on the bit about other cleanup in uninit() that may be causing problems here. but see below.
> Finally, imo, the correct fix is to uninit the panel in _fillDetailsPane
> (places.js) before initing it again. This should solve the fact we could start
> the panel with a certain itemId and uninit it with another one.
>
> What do you think about this?
i'm a little worried that uniniting the panel while scrolling through many history/bookmark items will be jittery experience. can you test patch v2 for this?
Reporter | ||
Comment 7•16 years ago
|
||
Thanks for looking into this! (Unassigning from myself.)
Assignee: asqueella → mak77
Assignee | ||
Comment 8•16 years ago
|
||
(In reply to comment #6)
> the code that Nickolay pointed out seems fragile as-is, should be more robust
> wrt to misuse by callers. should be able to resolve that w/o adding the
> bookmark observer for history items.
We could make editBookmarkOverlay itself being able to detect if someone is trying to call init multiple times without calling uninit, in such a case it could call uninit. We could set a _initialized private property and check that. Do you think that would be better than relying on the third party implementer to correctly call uninit before init (if needed)?
I suggest doing both, make the panel more robust but also fix the caller.
> i'm a little worried that uniniting the panel while scrolling through many
> history/bookmark items will be jittery experience. can you test patch v2 for
> this?
uninitpanel, if you don't force hiding elements, only removes observers and sets internal properties to null, so on the frontend nothing should happen unless it is inited again.
Comment 9•16 years ago
|
||
(In reply to comment #8)
> We could make editBookmarkOverlay itself being able to detect if someone is
> trying to call init multiple times without calling uninit, in such a case it
> could call uninit. We could set a _initialized private property and check
> that. Do you think that would be better than relying on the third party
> implementer to correctly call uninit before init (if needed)?
> I suggest doing both, make the panel more robust but also fix the caller.
sounds good.
> uninitpanel, if you don't force hiding elements, only removes observers and
> sets internal properties to null, so on the frontend nothing should happen
> unless it is inited again.
ok.
Assignee | ||
Comment 10•16 years ago
|
||
Nickolay, thanks for first approach!
this fixes both caller and panel
Attachment #320425 -
Attachment is obsolete: true
Attachment #355760 -
Attachment is obsolete: true
Attachment #355850 -
Flags: review?(dietrich)
Attachment #355760 -
Flags: review?(dietrich)
Updated•16 years ago
|
Attachment #355850 -
Flags: review?(dietrich) → review+
Comment 11•16 years ago
|
||
Comment on attachment 355850 [details] [diff] [review]
patch v2.1
r=me thanks!
Assignee | ||
Updated•16 years ago
|
Target Milestone: --- → Firefox 3.1
Assignee | ||
Updated•16 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Updated•16 years ago
|
Summary: [fix] Places library/organizer leaks the nsGlobalWindow when closed with a history entry selected → Places Library leaks the nsGlobalWindow when closed with a history entry selected
Assignee | ||
Comment 12•16 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: Firefox 3.1 → Firefox 3.2a1
Assignee | ||
Comment 13•16 years ago
|
||
i pushed an additional changeset to fix a typo that was causing oranges (the panel could not initialize)
http://hg.mozilla.org/mozilla-central/rev/8c4f6932ab41
Assignee | ||
Comment 14•16 years ago
|
||
Comment on attachment 355850 [details] [diff] [review]
patch v2.1
asking approval, risk is medium but this removes a lying around observer.
Attachment #355850 -
Flags: approval1.9.1?
Assignee | ||
Comment 15•16 years ago
|
||
potential dupes of this:
bug 431568
bug 423213
bug 423185
per IRC: Tomcat will take a look at them to see if those are still reproducible.
Comment 16•16 years ago
|
||
(In reply to comment #15)
> potential dupes of this:
> bug 431568
> bug 423213
> bug 423185
>
> per IRC: Tomcat will take a look at them to see if those are still
> reproducible.
all the bugs above are now fixed with this patch (and not leaking anymore) with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20090114 Shiretoko/3.1b3pre - great job guys ! - also verified fixed
Status: RESOLVED → VERIFIED
Assignee | ||
Comment 17•16 years ago
|
||
we need to write a browser-chrome test for this leak
Flags: in-testsuite?
Assignee | ||
Comment 18•16 years ago
|
||
Attachment #359673 -
Flags: review?(sdwilsh)
Assignee | ||
Comment 19•16 years ago
|
||
Attachment #359673 -
Attachment is obsolete: true
Attachment #359739 -
Flags: review?(sdwilsh)
Attachment #359673 -
Flags: review?(sdwilsh)
Assignee | ||
Comment 20•16 years ago
|
||
as done in other tests, we really should stop observing windows at a certain time.
Attachment #359739 -
Attachment is obsolete: true
Attachment #359790 -
Flags: review?(sdwilsh)
Attachment #359739 -
Flags: review?(sdwilsh)
Comment 21•16 years ago
|
||
Comment on attachment 359790 [details] [diff] [review]
leak browser-chrome test (unregister window watcher)
r=sdwilsh
Attachment #359790 -
Flags: review?(sdwilsh) → review+
Assignee | ||
Comment 22•16 years ago
|
||
pushed test on m-c:
http://hg.mozilla.org/mozilla-central/rev/e72773cfd493
Assignee | ||
Updated•16 years ago
|
Flags: in-testsuite? → in-testsuite+
Assignee | ||
Comment 23•16 years ago
|
||
asking wanted for the leak and the fact we never uninit panel on branch Library actually.
Flags: wanted-firefox3.1?
Comment 24•16 years ago
|
||
Comment on attachment 355850 [details] [diff] [review]
patch v2.1
a191=beltzner
Attachment #355850 -
Flags: approval1.9.1? → approval1.9.1+
Comment 25•16 years ago
|
||
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/07a3c2f8a1f4 (contains the typo fix)
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/73d3a5b8e2e3
Flags: in-litmus-
Keywords: fixed1.9.1
Updated•16 years ago
|
Keywords: fixed1.9.1 → verified1.9.1
Assignee | ||
Updated•16 years ago
|
Flags: wanted-firefox3.5?
Comment 26•15 years ago
|
||
Bug 451915 - move Firefox/Places bugs to Firefox/Bookmarks and History. Remove all bugspam from this move by filtering for the string "places-to-b-and-h".
In Thunderbird 3.0b, you do that as follows:
Tools | Message Filters
Make sure the correct account is selected. Click "New"
Conditions: Body contains places-to-b-and-h
Change the action to "Delete Message".
Select "Manually Run" from the dropdown at the top.
Click OK.
Select the filter in the list, make sure "Inbox" is selected at the bottom, and click "Run Now". This should delete all the bugspam. You can then delete the filter.
Gerv
Component: Places → Bookmarks & History
QA Contact: places → bookmarks
You need to log in
before you can comment on or make changes to this bug.
Description
•