Closed
Bug 592180
Opened 15 years ago
Closed 7 years ago
Sandboxes created early in application lifecycle aren't gc'd if they access some XPCOM functionality
Categories
(Core :: XPConnect, defect)
Tracking
()
RESOLVED
INACTIVE
People
(Reporter: avarma, Unassigned)
References
Details
Attachments
(2 files)
This is a bizarre bug, but I think I've reduced it down to a test case that's completely independent of Jetpack.
Reporter | ||
Comment 1•15 years ago
|
||
Reporter | ||
Comment 2•15 years ago
|
||
Comment on attachment 470699 [details]
example bootstrap.js for an extension
Here's a sample bootstrap.js for a trivial extension that reliably reproduces the bug on my system.
When the addon with this bootstrap.js is loaded at Firefox startup, the following is produced to the dump() console:
testLeak(false) = null testLeak(true) = [object Sandbox]
When it's loaded in the middle of a normal Firefox session, this is produced:
testLeak(false) = null testLeak(true) = null
The same text is output to an alert dialog if you copy the contents of bootstrap.js and paste it into the Firefox Error Console's "Code" field and click "Evaluate" while running Firefox.
Both testLeak(false) and testLeak(true) create a Cu.Sandbox with system principal that accesses the most recent browser window's content, but testLeak(true) goes further and QI's nsIInterfaceRequestor on it. This causes a leak when the call is made shortly after Firefox startup (after sessionstore-windows-restored), which is not cleaned up when Firefox is quit--as shown by the display of the following text when Firefox shuts down:
LEAK DETECTED: A WEAKREF LIVES!
This has befuddled me for a long time.
Attachment #470699 -
Attachment filename: bug-592180-patch.diff → bootstrap.js
Attachment #470699 -
Attachment is patch: false
Reporter | ||
Comment 3•15 years ago
|
||
Forgot to mention that the return value of testLeak() is the result of weakref.get() on a weak reference of the sandbox performed immediately after cyclic GC.
Reporter | ||
Comment 4•15 years ago
|
||
Note that the leaks occurring in bug 592176, bug 566351, and bug 574389 may be caused by whatever's causing this.
Reporter | ||
Comment 5•15 years ago
|
||
Here's a trivial extension containing the aforeuploaded bootstrap.js, for testing purposes.
Comment 6•14 years ago
|
||
A quick note to highlight bug 646343, that will help you running firefox in debug mode!
Comment 7•7 years ago
|
||
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INACTIVE
You need to log in
before you can comment on or make changes to this bug.
Description
•