Closed
Bug 819131
Opened 12 years ago
Closed 11 years ago
Cross-compartment DOM element references disappear from WeakMaps
Categories
(Core :: XPConnect, defect)
Core
XPConnect
Tracking
()
People
(Reporter: dcamp, Assigned: mccr8)
References
Details
(Keywords: regression)
Attachments
(1 file, 2 obsolete files)
5.15 KB,
patch
|
billm
:
review+
lsblakk
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
... unless I use an expando to keep the wrapper alive. This is a pain for some devtools work, we'd like to use WeakMaps against content nodes.
Assignee | ||
Comment 1•12 years ago
|
||
Bill, could this be a missing case for your CCW weakmap key stuff? Like maybe we don't handle CCWs for reflectors correctly or something annoying like that?
Assignee: nobody → wmccloskey
Comment 2•11 years ago
|
||
This is bug 655297 regressed. Steps to reproduce: * Go to about:config and make sure that devtools.chrome.enabled preference is set to true. * Go to http://www.heise.de/ and press Shift-F4 to open ScratchPad. * Open the Environment menu and select Browser. * Paste the following code into the ScratchPad: var weakMap = new WeakMap(); weakMap.set(content.document.body, "success"); window.QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIDOMWindowUtils) .garbageCollect(); alert(weakMap.get(content.document.body)); * Press Ctrl-R to run the code. Expected results: A message appears saying "success" (weak map entry still present). Actual results: A message appears saying "undefined" (weak map entry got garbage collected). For some reason, the issue is only reproducible on some websites - e.g. on bugzilla.mozilla.org I still get "success". On other websites like heise.de it is 100% reproducible however. So far I tested Firefox 18 and Firefox 21.0a1 (2013-01-21 nightly) on OpenSUSE, both are affected. Will try to determine a regression range, I'm pretty certain that Firefox 17 didn't exhibit this issue.
Keywords: regression
Comment 3•11 years ago
|
||
Regression range is http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=cb573b9307e5&tochange=0ff60bfb3442. Bill, please mark this bug as blocking bug 798678 - I don't have access. I assume that bug 798678 got merged into Firefox 18 despite landing during the Firefox 19 time frame.
Assignee | ||
Updated•11 years ago
|
Comment 4•11 years ago
|
||
We don't think this needs to be tracked for upcoming releases given its lack of severity - if it slows devtools work, we can take a low risk uplift to appropriate branches once resolved.
Assignee | ||
Comment 5•11 years ago
|
||
Well, I was nominating for tracking because we broke AdBlock Plus, it looks like...
you'll need to renominate if you want that fact taken into consideration.
Comment 7•11 years ago
|
||
Adblock Plus is using getUserData/setUserData again until this bug is fixed - the release is scheduled for next Tuesday. So this probably won't count as a serious reason.
Assignee | ||
Comment 8•11 years ago
|
||
Okay, thanks for the explanation. Sorry for the headache here. Bill, are you going to have time to look at this next week? If not, I can try my hand at it.
Flags: needinfo?(wmccloskey)
I don't think I'd be able to get to this until end of the week at the earliest. Any help is welcome :-).
Flags: needinfo?(wmccloskey)
Assignee | ||
Updated•11 years ago
|
Assignee: wmccloskey → continuation
Assignee | ||
Updated•11 years ago
|
status-b2g18:
--- → affected
status-b2g18-v1.0.0:
--- → affected
status-firefox18:
--- → wontfix
status-firefox19:
--- → wontfix
status-firefox20:
--- → affected
status-firefox21:
--- → affected
status-firefox-esr17:
--- → affected
Assignee | ||
Comment 10•11 years ago
|
||
As expected, the problem is that this key is a cross-compartment wrapper around a reflector. I think the solution is to do the preserveWrapper callback dance on the delegate as well as the key. I still need to write some more tests. The original test (included here) at least passes. I also need to try the STR from comment 2.
Attachment #689424 -
Attachment is obsolete: true
Assignee | ||
Comment 11•11 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=026c21d3391b
Attachment #708748 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Attachment #709252 -
Flags: review?(wmccloskey)
Comment on attachment 709252 [details] [diff] [review] preserve reflector delegates Review of attachment 709252 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for fixing this.
Attachment #709252 -
Flags: review?(wmccloskey) → review+
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 13•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/ffdee4a4eb7f
Keywords: checkin-needed
Assignee | ||
Comment 14•11 years ago
|
||
It would probably make sense to get this on Aurora. ESR17 would be nice, but on the other hand weak maps didn't really work very well on ESR10 so this isn't much of a regression there. So I guess for b2g18 and esr17 we should probably just let sleeping dogs lie.
Comment 15•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/ffdee4a4eb7f
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
Updated•11 years ago
|
Comment 16•11 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #14) > It would probably make sense to get this on Aurora. ESR17 would be nice, > but on the other hand weak maps didn't really work very well on ESR10 so > this isn't much of a regression there. So I guess for b2g18 and esr17 we > should probably just let sleeping dogs lie. Could you nominate an approval on Aurora?
Assignee | ||
Comment 17•11 years ago
|
||
Comment on attachment 709252 [details] [diff] [review] preserve reflector delegates [Approval Request Comment] Bug caused by (feature/regressing bug #): bug 798678 User impact if declined: causes problems for some addons and maybe some websites Testing completed (on m-c, etc.): m-c Risk to taking this patch (and alternatives if risky): low String or UUID changes made by this patch: none
Attachment #709252 -
Flags: approval-mozilla-aurora?
Comment 18•11 years ago
|
||
Batch edit: Bugs still affected on b2g18 after 2/13 merge to v1.0.1 branch are affected on v1.0.1 branch.
status-b2g18-v1.0.1:
--- → affected
Comment 19•11 years ago
|
||
Comment on attachment 709252 [details] [diff] [review] preserve reflector delegates low risk, approving for Aurora uplift.
Attachment #709252 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Assignee | ||
Comment 20•11 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/8c557b7c03a4
Comment 21•11 years ago
|
||
doesn't meet ESR uplift criteria, we'll get this in ESR24.
You need to log in
before you can comment on or make changes to this bug.
Description
•