Last Comment Bug 17390 - leaking documents and webshells while running editor
: leaking documents and webshells while running editor
Status: VERIFIED FIXED
[nsbeta3+]
: mlk
Product: Core
Classification: Components
Component: XUL (show other bugs)
: Trunk
: All Windows NT
: P1 normal (vote)
: M18
Assigned To: David Baron :dbaron: ⌚️UTC-7 (busy September 14-25)
:
:
Mentors:
: 17389 39855 42970 (view as bug list)
Depends on:
Blocks: 17557 21650 29702 33821 34663
  Show dependency treegraph
 
Reported: 1999-10-27 14:36 PDT by Warren Harris
Modified: 2008-07-31 02:48 PDT (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
LEAK AND BLOAT STATISTICS: Win32 console output (45.72 KB, text/plain)
1999-10-28 17:38 PDT, Pierre Saslawsky
no flags Details
patch to fix the "./mozilla -editor" startup leak (1.46 KB, patch)
2000-07-12 10:14 PDT, David Baron :dbaron: ⌚️UTC-7 (busy September 14-25)
no flags Details | Diff | Splinter Review
revised patch (3.49 KB, patch)
2000-07-19 20:26 PDT, David Baron :dbaron: ⌚️UTC-7 (busy September 14-25)
no flags Details | Diff | Splinter Review
revised patch, cleaning up a bunch of other issues in the same file (6.73 KB, patch)
2000-07-23 20:02 PDT, David Baron :dbaron: ⌚️UTC-7 (busy September 14-25)
no flags Details | Diff | Splinter Review
also needed (3.45 KB, patch)
2000-07-26 16:13 PDT, David Baron :dbaron: ⌚️UTC-7 (busy September 14-25)
no flags Details | Diff | Splinter Review
a diff -uw (ignoring whitespace) of that patch "also needed" (1.56 KB, patch)
2000-07-27 12:27 PDT, David Baron :dbaron: ⌚️UTC-7 (busy September 14-25)
no flags Details | Diff | Splinter Review

Description Warren Harris 1999-10-27 14:36:48 PDT
Akkana Peck did this:

  setenv XPCOM_MEM_BLOAT_LOG 1
  script
  apprunner -edit
  (typed a few characters, did Debug->Output HTML, then quit)
  ^D (to end the script)

and said:

   We're leaking 1023 nsCSSSelectors and 12 CSSStyleSheetImpls.

Pierre, can you investigate.

[PTD team: we don't know the extent of the memory bloat due to this yet. We
just know it's unnecessary.]
Comment 1 Pierre Saslawsky 1999-10-28 17:38:59 PDT
Created attachment 2458 [details]
LEAK AND BLOAT STATISTICS: Win32 console output
Comment 2 Pierre Saslawsky 1999-10-28 17:46:59 PDT
The style leaks are the result of leaks at a higher level. As you can see in the
attached Win32 console output, we are leaking the following objects:

     object               total leaked
     ------               ------------
     nsDocument              5
     DocumentViewerImpl     15
     nsWebShellWindow        3
     nsWebShell              6
     PresShell               7
     nsPresContext           7

We don't have a clear owner for nsDocument or nsWebShell so I'm humbly submitting
this to beard who's got the best tools in the Valley to do that kind of work.

Changed the summary line to "leaking documents and webshells" from "leaking
nsCSSSelectors and CSSStyleSheetImpls".
Comment 3 Pierre Saslawsky 1999-10-28 17:47:59 PDT
*** Bug 17389 has been marked as a duplicate of this bug. ***
Comment 4 Patrick C. Beard 1999-12-30 12:18:59 PST
I don't see these same leaks, but I see others. Leak detection is a
moving target.
Comment 5 Patrick C. Beard 2000-05-08 08:13:04 PDT
Style person should follow up on these leaks. They are evidently shutdown leaks, 
as they don't appear as transient leaks with the Boehm leak detector.
Comment 6 gordon 2000-05-08 10:14:36 PDT
On Mac, just starting up and shutting down leaks these, which prevent the 
nsIOService (and related services) from shutting down properly.

                       Total      Rem
CSSLoaderImpl             18        5
CSSParserImpl             90        7
CSSStyleSheetImpl         92       91
CSSStyleSheetInner        54       53

...but I don't see the same problem on WindowsNT.
Comment 7 Pierre Saslawsky 2000-05-25 19:53:50 PDT
CCd attinasi. Gordon says that it only happens in the Mac but it may be related 
to the other XP leaks that Marc has on his list.
Comment 8 Pierre Saslawsky 2000-05-25 19:54:29 PDT
Really CCd attinasi...
Comment 9 Pierre Saslawsky 2000-06-12 03:54:16 PDT
How come this is still on my list?
Trying for the 3rd time to reassign to attinasi...
Comment 10 Marc Attinasi 2000-06-15 11:35:02 PDT
This bug has been marked "future" because the original netscape engineer working 
on this is over-burdened. If you feel this is an error, that you or another 
known resource will be working on this bug,or if it blocks your work in some way 
-- please attach your concern to the bug for reconsideration.
Comment 11 Warren Harris 2000-06-21 18:18:46 PDT
=> TK at AOL
Comment 12 Warren Harris 2000-07-11 15:34:42 PDT
reassigning to dbaron
Comment 13 David Baron :dbaron: ⌚️UTC-7 (busy September 14-25) 2000-07-11 16:43:08 PDT
I believe the fix I attached yesterday to bug 24645 should fix this bug.  The 
root of the leak was the XUL keybinding document table, which was intentionally 
leaked to fix bug 27739.  However, just releasing the table was not sufficient 
because nobody was breaking the circular references between the keybinding 
documents (nsXULDocument objects) and their script objects, which would explain 
the state of this bug before.  (Note that there were 3 XULDocumentImpl leaked in 
pierre's original bloat log attached above.  This is what I saw before breaking 
the circular references.)
Comment 14 David Baron :dbaron: ⌚️UTC-7 (busy September 14-25) 2000-07-11 16:45:53 PDT
Proposed patch is:
http://bugzilla.mozilla.org/showattachment.cgi?attach_id=11213
Comment 15 David Baron :dbaron: ⌚️UTC-7 (busy September 14-25) 2000-07-11 22:09:03 PDT
Actually, this doesn't fix all the leaks when starting with mozilla -editor.  
I'm working on this new leak.  In fact, I'm writing a tutorial by writing down 
exactly what I do to find it.  It's going to be an interesting tutorial...
Comment 16 David Baron :dbaron: ⌚️UTC-7 (busy September 14-25) 2000-07-11 23:50:05 PDT
Part or all of the remaining leak has something to do with DocumentType objects
not having their script objects un-rooted when the
nsDocument::SetScriptGlobalObject(null) is called.  This function needs to call
SetDocument on all the elements in mProlog and mEpilog instead of just on
mRootContent.  Probably it needs to do the same elsewhere.

I'm not sure if that will fix the whole thing.  There may be a problem with
SetOpenerWindow too...
Comment 17 David Baron :dbaron: ⌚️UTC-7 (busy September 14-25) 2000-07-12 10:14:53 PDT
Created attachment 11293 [details] [diff] [review]
patch to fix the "./mozilla -editor" startup leak
Comment 18 David Baron :dbaron: ⌚️UTC-7 (busy September 14-25) 2000-07-19 20:26:57 PDT
Created attachment 11614 [details] [diff] [review]
revised patch
Comment 19 David Baron :dbaron: ⌚️UTC-7 (busy September 14-25) 2000-07-23 20:02:30 PDT
Created attachment 11801 [details] [diff] [review]
revised patch, cleaning up a bunch of other issues in the same file
Comment 20 David Baron :dbaron: ⌚️UTC-7 (busy September 14-25) 2000-07-26 16:13:08 PDT
Created attachment 11980 [details] [diff] [review]
also needed
Comment 21 David Baron :dbaron: ⌚️UTC-7 (busy September 14-25) 2000-07-27 12:27:49 PDT
Created attachment 12018 [details] [diff] [review]
a diff -uw (ignoring whitespace) of that patch "also needed"
Comment 22 David Baron :dbaron: ⌚️UTC-7 (busy September 14-25) 2000-07-27 16:47:12 PDT
I checked in the keybindings table / keybindings document part of the fix.
Comment 23 David Baron :dbaron: ⌚️UTC-7 (busy September 14-25) 2000-08-06 13:25:26 PDT
Was unable to check in due to cvs lock in layout/html/style/src.  Will try again
another time.
Comment 24 David Baron :dbaron: ⌚️UTC-7 (busy September 14-25) 2000-08-06 20:05:10 PDT
Fix checked in, 2000-08-06 20:03 PDT.
Comment 25 Stuart Parmenter 2000-08-17 17:49:37 PDT
*** Bug 42970 has been marked as a duplicate of this bug. ***
Comment 26 shrirang khanzode 2000-09-13 15:13:57 PDT
verified that the patches are in. Marking as such.
Comment 27 David Baron :dbaron: ⌚️UTC-7 (busy September 14-25) 2000-11-12 06:38:30 PST
*** Bug 39855 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.