Closed
Bug 483818
Opened 16 years ago
Closed 16 years ago
Leak when script appended via DOM does document.write
Categories
(Core :: DOM: HTML Parser, defect)
Core
DOM: HTML Parser
Tracking
()
VERIFIED
FIXED
People
(Reporter: bzbarsky, Assigned: sicking)
References
Details
(4 keywords)
Attachments
(3 files, 1 obsolete file)
298 bytes,
text/html
|
Details | |
9.48 KB,
patch
|
sicking
:
review+
sicking
:
superreview+
|
Details | Diff | Splinter Review |
13.73 KB,
patch
|
sicking
:
review+
sicking
:
superreview+
samuel.sidler+old
:
approval1.9.0.11+
|
Details | Diff | Splinter Review |
Testcase coming up. This caused leaks during mochitest on the test for bug 482659.
![]() |
Reporter | |
Comment 1•16 years ago
|
||
Oh, and once this is fixed the relevant part of that mochitest should be reenabled.
![]() |
Reporter | |
Comment 2•16 years ago
|
||
On all branches, of course.
![]() |
Reporter | |
Comment 3•16 years ago
|
||
This leaks. It also asserts:
###!!! ASSERTION: Too many calls to ScriptDidExecute: 'mScriptsExecuting > 0', file /Users/bzbarsky/mozilla/debug/mozilla/parser/htmlparser/src/nsParser.cpp, line 1824
![]() |
Reporter | |
Comment 4•16 years ago
|
||
OK, it looks like the nsContentSink gets a ScriptEvaluated but not a ScriptAvailable for that script. Or something.
Flags: blocking1.9.1?
![]() |
Reporter | |
Comment 5•16 years ago
|
||
And the key to that is this stack:
#0 nsScriptLoader::AddObserver (this=0xa973e0, aObserver=0x32d10c0) at nsScriptLoader.h:88
#1 0x0381117a in nsContentSink::Init (this=0x1440a00, aDoc=0x161f400, aURI=0xd803490, aContainer=0xc70f070, aChannel=0xd8c0060) at /Users/bzbarsky/mozilla/debug/mozilla/content/base/src/nsContentSink.cpp:251
#2 0x039c8a16 in HTMLContentSink::Init (this=0x1440a00, aDoc=0x161f400, aURI=0xd803490, aContainer=0xc70f070, aChannel=0xd8c0060) at /Users/bzbarsky/mozilla/debug/mozilla/content/html/document/src/nsHTMLContentSink.cpp:1642
#3 0x039c91e0 in NS_NewHTMLContentSink (aResult=0xbfff9e20, aDoc=0x161f400, aURI=0xd803490, aContainer=0xc70f070, aChannel=0xd8c0060) at /Users/bzbarsky/mozilla/debug/mozilla/content/html/document/src/nsHTMLContentSink.cpp:1519
#4 0x039dc00c in nsHTMLDocument::OpenCommon (this=0x161f400, aContentType=@0xbfff9f84, aReplace=0) at /Users/bzbarsky/mozilla/debug/mozilla/content/html/document/src/nsHTMLDocument.cpp:2003
#5 0x039dc362 in nsHTMLDocument::Open (this=0x161f400, aContentType=@0xbfff9f84, aReplace=0, aReturn=0xbfff9f7c) at /Users/bzbarsky/mozilla/debug/mozilla/content/html/document/src/nsHTMLDocument.cpp:2059
#6 0x039d3cd6 in nsHTMLDocument::Open (this=0x161f400) at /Users/bzbarsky/mozilla/debug/mozilla/content/html/document/src/nsHTMLDocument.cpp:2052
#7 0x039d24e9 in nsHTMLDocument::WriteCommon (this=0x161f400, aText=@0xbfffa11c, aNewlineTerminate=0) at /Users/bzbarsky/mozilla/debug/mozilla/content/html/document/src/nsHTMLDocument.cpp:2160
![]() |
Reporter | |
Comment 6•16 years ago
|
||
If I add a check to avoid decrementing mScriptsExecuting when it's 0, the leak goes away.
Almost certainly a regression from bug 444322, so needed on 1.9.0 too.
As far as I can see, an arbitrary number of scripts can be in the middle of executing when the content sink is suddenly created. Would it make sense to keep track of this "number of scripts executing" thing on the document instead of on the parser or something?
Flags: blocking1.9.0.9?
Comment 7•16 years ago
|
||
Whose bug is this? (I mean who should take assignment?)
/be
OS: Mac OS X → All
Hardware: x86 → All
![]() |
Reporter | |
Comment 8•16 years ago
|
||
Some combination of Blake, sicking, Peter, me, I would think...
Updated•16 years ago
|
Flags: blocking1.9.1? → blocking1.9.1+
Assignee | ||
Updated•16 years ago
|
Assignee: mrbkap → jonas
Updated•16 years ago
|
Assignee | ||
Comment 10•16 years ago
|
||
Patch + testcase.
Instead of having the parser keep track of if we're executing scripts or not, simply ask the scriptloader, it already knows!
Attachment #372979 -
Flags: superreview?(mrbkap)
Attachment #372979 -
Flags: review?(mrbkap)
Comment 11•16 years ago
|
||
Comment on attachment 372979 [details] [diff] [review]
Patch to fix
>+ * Returns true if there's currently scripts executing that we need to hold
"there's" should be "there are".
Attachment #372979 -
Flags: superreview?(mrbkap)
Attachment #372979 -
Flags: superreview+
Attachment #372979 -
Flags: review?(mrbkap)
Attachment #372979 -
Flags: review+
Assignee | ||
Comment 12•16 years ago
|
||
Also renamed the function to 'IsScriptExecuting' per discussion with mrbkap.
Attachment #372979 -
Attachment is obsolete: true
Attachment #372994 -
Flags: superreview+
Attachment #372994 -
Flags: review+
Assignee | ||
Comment 13•16 years ago
|
||
Checked in to m-c and 1.9.1 branches.
http://hg.mozilla.org/mozilla-central/rev/4ec870426c6a
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/894e9e3bdf3e
Updated•16 years ago
|
Flags: in-litmus?
Assignee | ||
Comment 14•16 years ago
|
||
Don't think we need a litmus test given that there's an automated test in the patch that landed which should test this
Flags: in-testsuite+
Flags: in-litmus?
Flags: in-litmus-
Comment 15•16 years ago
|
||
Sorry, pushed the wrong button.
Comment 16•16 years ago
|
||
Do we need a separate 1.9.0 patch or will this apply?
Assignee | ||
Comment 17•16 years ago
|
||
Needs a separate patch since it's changing interfaces :( I will write one.
Assignee | ||
Comment 18•16 years ago
|
||
Same as trunk patch except without changing the nsIContentSink interface, so forwarding r/sr after checking with mrbkap.
Attachment #374235 -
Flags: superreview+
Attachment #374235 -
Flags: review+
Assignee | ||
Comment 19•16 years ago
|
||
Checked in to 1.9.0 branch. Asking for retroactive approval given that I checked in just a few mins before freeze
Keywords: fixed1.9.0
Assignee | ||
Updated•16 years ago
|
Attachment #374235 -
Flags: approval1.9.0.10?
Updated•16 years ago
|
Keywords: fixed1.9.0 → fixed1.9.0.10
Comment 20•16 years ago
|
||
I think this caused 1.9.0 linux unit test orange.
Comment 21•16 years ago
|
||
Seems like the commit missed the test file.
Assignee | ||
Comment 22•16 years ago
|
||
Indeed, forgetting the crappyness of CVS was something my brain gladly did.
Comment 23•16 years ago
|
||
Comment on attachment 374235 [details] [diff] [review]
1.9.0 branch fix
Retroactive... Approved for 1.9.0.11. a=ss
(Note: We re-versioned 1.9.0.10 to be 1.9.0.11 and have extended code freeze by a week or so.)
Attachment #374235 -
Flags: approval1.9.0.11? → approval1.9.0.11+
Comment 24•16 years ago
|
||
verified FIXED with the attached testcase on builds:
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090430 Minefield/3.6a1pre ID:20090430031133
and
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b5pre) Gecko/20090430 Shiretoko/3.5b5pre ID:20090430031222
Status: RESOLVED → VERIFIED
Keywords: fixed1.9.1 → verified1.9.1
Comment 25•16 years ago
|
||
Verified fixed for 1.9.0.11. Tested with my debug build (Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.11pre) Gecko/2009051111 GranParadiso/3.0.11pre).
Keywords: fixed1.9.0.11 → verified1.9.0.11
You need to log in
before you can comment on or make changes to this bug.
Description
•