Last Comment Bug 751621 - Wrappers & TypeError: can't access dead object
: Wrappers & TypeError: can't access dead object
Status: RESOLVED WORKSFORME
[firebug-p1]
: regression
Product: Core
Classification: Components
Component: DOM (show other bugs)
: 15 Branch
: x86 Windows Vista
: -- normal with 2 votes (vote)
: ---
Assigned To: Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary)
:
:
Mentors:
Depends on:
Blocks: hueyfix 751420
  Show dependency treegraph
 
Reported: 2012-05-03 10:21 PDT by Jan Honza Odvarko [:Honza]
Modified: 2012-06-13 12:34 PDT (History)
15 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Possible Patch (1.31 KB, patch)
2012-05-07 08:11 PDT, Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary)
no flags Details | Diff | Splinter Review

Description Jan Honza Odvarko [:Honza] 2012-05-03 10:21:01 PDT
This could be a regression caused by bug 695480

I am now seeing bunch of "TypeError: can't access dead object".
This sounds good in general (since useful for mem leaks), but I am
also seeing the exception for the following code:

STR (you should be able to use Scratchpad):
var object = gBrowser.selectedBrowser.contentWindow.wrappedJSObject;
var parent = Object.getPrototypeOf(object);
Object.keys(parent);  // EXCEPTION

If the |object| is set to be:
"gBrowser.selectedBrowser.contentWindow" (no wrapper) it works.


I have also discussed the problem here:
http://groups.google.com/group/mozilla.dev.platform/browse_thread/thread/bf9419c4012b5b0d?hl=en#

Honza
Comment 1 Jan Honza Odvarko [:Honza] 2012-05-04 07:48:48 PDT
I am also marking as [firebug-p1] since several pieces of Firebug are broken by this issue.

Honza
Comment 2 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2012-05-07 07:08:54 PDT
I think the problem here is that we have magic to ensure that we don't kill wrappers to the Window object, but that magic doesn't consider the prototype chain of the Window object (which we should also not kill).
Comment 3 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2012-05-07 08:11:17 PDT
Created attachment 621605 [details] [diff] [review]
Possible Patch

I can't reproduce this ... Honza, could you test this patch?
Comment 4 Jan Honza Odvarko [:Honza] 2012-05-08 07:30:13 PDT
(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #3)
> Created attachment 621605 [details] [diff] [review]
> Possible Patch
> 
> I can't reproduce this ... Honza, could you test this patch?

I can't reproduce the problem any more (I didn't test the patch)

It works for me in the latest Nightly:
http://hg.mozilla.org/mozilla-central/rev/448f554f6acb

So, it looks like it has been fixed along the way...

---

Just in case somebody would be interested, I repeated the testing with:
http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2012-05-03-03-05-12-mozilla-central/firefox-15.0a1.en-US.win32.zip

Build From: http://hg.mozilla.org/mozilla-central/rev/807403a04a6a


Better STR:
1) Download Firebug source git@github.com:firebug/firebug.git
2) Install two extensions (run them directly from the source)
Path to Firebug extension: <root>\firebug\extension
Path to FBTrace extension: <root>\firebug\trace\FBTrace

3) Run Firefox and load www.google.com
4) Press F12 to open Firebug UI
5) Select the Dom panel
6) Refresh the page, the DOM panel suddenly displays: There are no properties to show for this object. -> This is s symptom of the BUG

7) Now open FBTrace console (Firebug icon menu -> Open Firebug Tracing)
8) Click Tools button in the toolbar, a command line at the bottom of the window should be opened.

9) Put the following code into the command line:

var object = gBrowser.selectedBrowser.contentWindow.wrappedJSObject;
var parent = Object.getPrototypeOf(object);
Object.keys(parent);  // EXCEPTION

Press Evaluate (in the command line toolbar)

Now you should see "EXCEPTION TypeError: can't access dead object" in the FBTrace console.

---

I don't know if anyone is interested in more details, but since it works in latest Nightly, it can be probably closed....

Honza

Note You need to log in before you can comment on or make changes to this bug.