Closed Bug 467008 Opened 16 years ago Closed 16 years ago

[FIX]Pointing to a non-existing binding locally seems to leak documents

Categories

(Core :: XBL, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: martijn.martijn, Assigned: bzbarsky)

References

(Depends on 1 open bug)

Details

(Keywords: memory-leak, testcase)

Attachments

(2 files)

Attached file testcase
See testcase, open it locally, I see these leaks with the nspr log tool and leak gauge:
Results of processing log leak1.log :
Leaked document at address 30ea400.
 ... with URI "jar:file:///C:/Documents%20and%20Settings/mw/Bureaublad/moz/firefox20081127/chrome/toolkit.jar!/content/global/bindings/scrollbar.xml".
 ... with URI "chrome://global/content/bindings/scrollbar.xml".
Leaked document at address 30ea800.
 ... with URI "file:///C:/Documents%20and%20Settings/mw/Bureaublad/notexisting".
Leaked content nodes associated with node info manager at address 312a490.
 ... with document URI "file:///C:/Documents%20and%20Settings/mw/Bureaublad/notexistingbindingleak.htm".
Leaked content nodes associated with node info manager at address 3141160.
 ... with document URI "jar:file:///C:/Documents%20and%20Settings/mw/Bureaublad/moz/firefox20081127/chrome/toolkit.jar!/content/global/bindings/scrollbar.xml".
 ... with document URI "chrome://global/content/bindings/scrollbar.xml".
Leaked content nodes associated with node info manager at address 3141a90.
 ... with document URI "file:///C:/Documents%20and%20Settings/mw/Bureaublad/notexisting".

Summary:
Leaked 0 out of 0 DOM Windows
Leaked 2 out of 36 documents
Leaked 0 out of 5 docshells
Leaked content nodes in 3 out of 46 documents

It doesn't seem to leak when opened from a network.
Do I need to enable some pref? 
I get Security Error: Content at file:///home/smaug/mozilla/tests/ may not load data from file:///home/smaug/mozilla/tests/notexisting#x.
Ah, apparently you need to have the security.fileuri.strict_origin_policy pref set to false.
Summary: Pointing to a non-existing binding locally seems to leak → Pointing to a non-existing binding locally seems to leak documents
Attached patch FixSplinter Review
I hate our XBL code.
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #351317 - Flags: superreview?(jonas)
Attachment #351317 - Flags: review?(jonas)
Summary: Pointing to a non-existing binding locally seems to leak documents → [FIX]Pointing to a non-existing binding locally seems to leak documents
Comment on attachment 351317 [details] [diff] [review]
Fix

Should we add these things to the cycle collector as well? If so, would be great with a new bug on that.
Attachment #351317 - Flags: superreview?(jonas)
Attachment #351317 - Flags: superreview+
Attachment #351317 - Flags: review?(jonas)
Attachment #351317 - Flags: review+
I think we have an existing bug on that, actually.  The issue here was that we'd stick it in the hashtable too, so we want this patch anyway.
Pushed http://hg.mozilla.org/mozilla-central/rev/89dbc542270b.

Do we need a mochitest here?  In that case bug 424484 blocks the test.  Or can leaks be detected in reftest?
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Depends on: 424484
Flags: in-testsuite?
Resolution: --- → FIXED
Er, I guess for file:// in our default config we can't use reftest here, so we do need mochitest.
Verified fixed, using:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2a1pre) Gecko/20081214 Minefield/3.2a1pre

Thanks for fixing this, Boris, very useful to me.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: