Closed Bug 500931 Opened 17 years ago Closed 17 years ago

xpcIJSWeakReference.get() unwraps XPCNativeWrapper

Categories

(Core :: XPConnect, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
blocking1.9.1 --- -
status1.9.1 --- .2-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)

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.
Flags: blocking1.9.1?
Flags: blocking1.9.1.1?
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
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-
Attached patch Proposed fix (obsolete) — — Splinter Review
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?
Attachment #385866 - Flags: review? → review?(bent.mozilla)
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!
Attached patch Cleaned up — — Splinter Review
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)
Attachment #385880 - Flags: superreview?(jst) → superreview+
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Backed out due to leaks.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
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.
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
Status: REOPENED → RESOLVED
Closed: 17 years ago → 17 years ago
Resolution: --- → FIXED
Flags: wanted1.9.1.x+
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?]
blocking1.9.1: --- → ?
Blake: Any reason this should block? Definitely wanted, but sell me on the blocking.
blocking1.9.1: ? → -
Flags: wanted1.9.1.x+
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 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+
We probably want it on 1.9.0.
Depends on: 501577
Flags: wanted1.9.0.x+
Flags: blocking1.9.0.13?
Flags: blocking1.9.0.13? → blocking1.9.0.13+
Please advise on how this can be verified on fx3.5.2. Thanks.
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.
thats good enough for me. marking this verified1.9.1
Keywords: verified1.9.1
(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.
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 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+
Keywords: fixed1.9.0.14
Verifying it for 1.9.0.14 based on passing test.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: