Closed
Bug 500931
Opened 17 years ago
Closed 17 years ago
xpcIJSWeakReference.get() unwraps XPCNativeWrapper
Categories
(Core :: XPConnect, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jwkbugzilla, Assigned: mrbkap)
References
Details
(Keywords: regression, verified1.9.0.14, verified1.9.1, Whiteboard: [1.9.1.2?])
Attachments
(1 file, 1 obsolete file)
|
7.70 KB,
patch
|
mrbkap
:
review+
jst
:
superreview+
samuel.sidler+old
:
approval1.9.1.2+
dveditz
:
approval1.9.0.14+
|
Details | Diff | Splinter Review |
If you access an unsafe object from an extension it gets wrapped automatically:
dump(doc); // prints "[object XPCNativeWrapper [object HTMLDocument]]"
However, if you get a weak reference to this object and then get the value - the wrapper is gone:
doc = Components.utils.getWeakReference(doc);
dump(doc.get()); // prints "[object HTMLDocument]"
This didn't happen in Firefox 3.0.11 but I see this behavior in both trunk and 3.5 nightlies.
| Reporter | ||
Comment 1•17 years ago
|
||
Regression range on trunk is 44d20da17412 to f9e5c69f3a93: http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=44d20da17412&tochange=f9e5c69f3a93
Updated•17 years ago
|
Flags: blocking1.9.1?
Flags: blocking1.9.1.1?
| Reporter | ||
Comment 2•17 years ago
|
||
Regression range on 1.9.1 branch is c11e41845954 to 5b61f163f2fd: http://hg.mozilla.org/releases/mozilla-1.9.1/pushloghtml?fromchange=c11e41845954&tochange=5b61f163f2fd
This should be caused by bug 475864 then.
Blocks: 475864
Comment 3•17 years ago
|
||
This was nominated to block the final release of Firefox 3.5 without any rationale; I assume that was just flag tweaking to get attention? Renominate if you have a reason why we should stop-ship on Firefox 3.5 for this issue.
Flags: blocking1.9.1? → blocking1.9.1-
| Assignee | ||
Comment 4•17 years ago
|
||
I could take the thisObject hook and make the relevant code a static function somewhere, but this seemed easier. Explanation in the comment in the patch.
Assignee: nobody → mrbkap
Status: NEW → ASSIGNED
Attachment #385866 -
Flags: superreview?(jst)
Attachment #385866 -
Flags: review?
| Assignee | ||
Updated•17 years ago
|
Attachment #385866 -
Flags: review? → review?(bent.mozilla)
Updated•17 years ago
|
Attachment #385866 -
Flags: review?(bent.mozilla) → review+
Comment on attachment 385866 [details] [diff] [review]
Proposed fix
>+ if (!cx) return NS_ERROR_UNEXPECTED;
Ugh, let's get this on two lines. And the other instance too!
| Assignee | ||
Comment 6•17 years ago
|
||
This has a unit test, it removes the stray bit of JS in browser.js I was using to test with and it addresses bent's review comments. Carrying forward his review...
Attachment #385866 -
Attachment is obsolete: true
Attachment #385880 -
Flags: superreview?(jst)
Attachment #385880 -
Flags: review+
Attachment #385866 -
Flags: superreview?(jst)
Updated•17 years ago
|
Attachment #385880 -
Flags: superreview?(jst) → superreview+
| Assignee | ||
Comment 7•17 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 8•17 years ago
|
||
Backed out due to leaks.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Assignee | ||
Comment 9•17 years ago
|
||
For the record, the leaks involved have nothing to do with the patch. Somehow, xpcJSWeakReferences cause leaks and the patch makes this a problem because it adds a (chrome) mochitest that tests them.
| Reporter | ||
Comment 10•17 years ago
|
||
Confirmed, xpcIJSWeakReference causes memory leaks. Not blocking Adblock Plus any more, I am using nsISupportsWeakReference directly now which doesn't exhibit any issues in current releases.
No longer blocks: abp
| Assignee | ||
Comment 11•17 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 17 years ago → 17 years ago
Resolution: --- → FIXED
Updated•17 years ago
|
Flags: wanted1.9.1.x+
Comment 12•17 years ago
|
||
Not *blocking* 1.9.1.1, but we'll consider a patch and it might block 1.9.1.2, if we don't take it in 1.9.1.1.
Flags: blocking1.9.1.1?
Whiteboard: [1.9.1.2?]
Updated•17 years ago
|
blocking1.9.1: --- → ?
Comment 13•17 years ago
|
||
Blake: Any reason this should block? Definitely wanted, but sell me on the blocking.
| Assignee | ||
Comment 14•17 years ago
|
||
Comment on attachment 385880 [details] [diff] [review]
Cleaned up
I don't know if I can sell blocking, but as long as this lands, I don't mind.
Attachment #385880 -
Flags: approval1.9.1.2?
Comment 15•17 years ago
|
||
Comment on attachment 385880 [details] [diff] [review]
Cleaned up
Approved for 1.9.1.2. a=ss for release-drivers
Please land on mozilla-1.9.1 and use the ".2-fixed" option of the "status1.9.1" flag.
We don't need this on 1.9.0, right?
Attachment #385880 -
Flags: approval1.9.1.2? → approval1.9.1.2+
| Assignee | ||
Comment 16•17 years ago
|
||
| Assignee | ||
Comment 17•17 years ago
|
||
We probably want it on 1.9.0.
Updated•17 years ago
|
Flags: wanted1.9.0.x+
Flags: blocking1.9.0.13?
Updated•17 years ago
|
Flags: blocking1.9.0.13? → blocking1.9.0.13+
Comment 18•17 years ago
|
||
Please advise on how this can be verified on fx3.5.2. Thanks.
| Assignee | ||
Comment 19•17 years ago
|
||
Tony: Can you use the fact that there is a mochichrome test that passes on tinderboxes to verify this? If not, Wladimir might be the best person.
Comment 20•17 years ago
|
||
thats good enough for me. marking this verified1.9.1
Keywords: verified1.9.1
Comment 21•17 years ago
|
||
(In reply to comment #17)
> We probably want it on 1.9.0.
Probably? or really? will take your approval1.9.0.14? request on a patch as the answer.
| Assignee | ||
Comment 22•17 years ago
|
||
Comment on attachment 385880 [details] [diff] [review]
Cleaned up
I was not sure because I was seeing leaks with both this patch and the patch for bug 501577 applied. But I'm seeing those leaks without either of these patches, so this isn't the cause. This should be ready to go.
Attachment #385880 -
Flags: approval1.9.0.14?
Comment 23•17 years ago
|
||
Comment on attachment 385880 [details] [diff] [review]
Cleaned up
Approved for 1.9.0.14, a=dveditz for release-drivers
Attachment #385880 -
Flags: approval1.9.0.14? → approval1.9.0.14+
| Assignee | ||
Updated•17 years ago
|
Keywords: fixed1.9.0.14
Comment 24•17 years ago
|
||
Verifying it for 1.9.0.14 based on passing test.
Keywords: fixed1.9.0.14 → verified1.9.0.14
You need to log in
before you can comment on or make changes to this bug.
Description
•