Closed
Bug 731471
Opened 13 years ago
Closed 13 years ago
Don't reparent wrappers that don't want to move
Categories
(Core :: XPConnect, defect)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
mozilla13
People
(Reporter: bholley, Assigned: bholley)
References
Details
Attachments
(1 file)
1.44 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
I thought this was a bug when reading this code long ago, and now I've finally hit it with compartment-per-global.
In the wrapper reparenting code, we call PreCreate on the object to see what parent it wants. If it directly wants the old global, we leave it be. But if it just wants something in the old scope, we reparent _that_ thing first, and then continue.
Unfortunately, we don't check whether the parent actually moved scopes, but just assume that it did. So we don't handle the case where parent wants to stay in the old scope. Instead, we proceed along our merry way, and, if the two scopes are in different compartments, hit a compartment mismatch assertion.
This stuff is kind of a mess, but I don't think it's worth the effort to refactor, since it'll probably go away once the new bindings settle.
Assignee | ||
Comment 1•13 years ago
|
||
Attaching a patch. Flagging peterv for review.
Attachment #601477 -
Flags: review?(peterv)
Comment 2•13 years ago
|
||
MOZ_ASSERT, perhaps?
Assignee | ||
Comment 3•13 years ago
|
||
(In reply to Ms2ger from comment #2)
> MOZ_ASSERT, perhaps?
I want this one to be nonfatal. I can imagine it firing during automation or something, and I'd rather not have to drop everything to fix it.
Comment 4•13 years ago
|
||
Comment on attachment 601477 [details] [diff] [review]
Don't reparent wrappers that don't want to move. v1
Please add the crashtest from bug 716383.
Attachment #601477 -
Flags: review?(peterv) → review+
Assignee | ||
Comment 6•13 years ago
|
||
(In reply to Peter Van der Beken [:peterv] from comment #4)
> Please add the crashtest from bug 716383.
So, the test relies on window.open, which doesn't work in crashtests (reftests can't open new windows). It's also a non-fatal assertion (and not one that we clearly want to make fatal), so we can't use a mochitest either. I tried rewriting the testcase to use an iframe, but I couldn't get the assertion to fire.
So, barring any further directives from peter, I'm just going to check this in without the test. I've manually verified that it does indeed fix it, though.
Pushed to try: https://tbpl.mozilla.org/?tree=Try&rev=719a35c0ba4b
Assignee | ||
Comment 7•13 years ago
|
||
Looks green. Pushed to m-i:
http://hg.mozilla.org/integration/mozilla-inbound/rev/7609e085d456
Target Milestone: --- → mozilla13
Comment 8•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment 9•13 years ago
|
||
> It's also a non-fatal assertion (and not one that we clearly want to make fatal),
> so we can't use a mochitest either.
Please check in a mochitest and add your +1 to bug 404077. It's worth adding the test even if it won't catch an exact regression right away.
Flags: in-testsuite?
Assignee | ||
Comment 10•12 years ago
|
||
(In reply to Jesse Ruderman from comment #9)
> > It's also a non-fatal assertion (and not one that we clearly want to make fatal),
> > so we can't use a mochitest either.
>
> Please check in a mochitest and add your +1 to bug 404077. It's worth
> adding the test even if it won't catch an exact regression right away.
https://hg.mozilla.org/integration/mozilla-inbound/rev/aca558fd4bfb
Flags: in-testsuite? → in-testsuite+
Comment 11•12 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•