What does “can’t access dead object” mean?

Jorge Villalobos

35

Firefox 15 introduced a major improvement in memory usage, by disallowing add-ons to keep references to DOM objects after their parent document was destroyed. This eliminates the most common cause of memory leaks in add-ons, and should reduce memory consumption for many users.

If you install an add-on that causes this kind of memory leak, starting with Firefox 15 you’ll see errors like this in the Error Console:

Error: TypeError: can't access dead object
Source File: chrome://addon/content/file.js
Line: 42

This means that Firefox did the right thing and prevented the add-on from holding on to this object. However, it also means that the add-on probably won’t work correctly.

If you run into this error, please contact the developers and point them to this post. Or get in touch with us on the comments and we’ll try to contact them ourselves.

35 responses

  1. Frazer Ramsay wrote on :

    Getting this error from flickr.

    1. Jorge Villalobos wrote on ::

      Do you have any add-ons installed?

  2. Ben wrote on :

    How do I identify which add-on is causing/having the problem?

    1. Jorge Villalobos wrote on ::

      The error normally has a chrome: or resource: URL that should hint which add-on it is referring to. You can post the full error message here and I might be able to help you figure it out.

      Alternatively, you can disable your add-ons one by one until and reproduce the problem until you find the culprit.

      1. daniel wrote on :

        this error appaer whant i made research on google starting from firefox page
        some time i succès to eliminate by pressing on his OK, on the alert but some time is reappearing wihout ending , than i have to restart windows 7

      2. poorna wrote on :

        [error] isNewPageLoaded found an old pageLoadError: TypeError: can’t access dead object
        [warn] Stack is: BrowserBot.prototype._handleClosedSubFrame@chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:1245 BrowserBot.prototype.getCurrentWindow@chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:1223 BrowserBot.prototype.pollForLoad@chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:955 BrowserBot.prototype.reschedulePoller/pollerFunction@chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:1093 BrowserBot.prototype.runScheduledPollers@chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:1103 TestLoop.prototype.continueTestWhenConditionIsTrue@chrome://selenium-ide/content/selenium-core/scripts/selenium-executionloop.js:138 .continueTestWhenConditionIsTrue@chrome://selenium-ide/content/selenium-runner.js:133 retval@chrome://selenium-ide/content/selenium-core/scripts/htmlutils.js:60
        [error] can’t access dead object

        1. Jorge Villalobos wrote on ::

          Well, this error is caused by Selenium, which you can see mentioned in several comments here. It’s up to the Selenium add-on developers to figure out a solution.

  3. Troy Jones wrote on :

    I get this error on the Sydney Morning Herald website.. It pops up twice per page that I open. It requires me to click ok, it goes away, then comes back again. It does that on each new page I read.

    1. Jorge Villalobos wrote on ::

      Which add-ons do you have installed?

  4. Dave Paterson wrote on :

    We are seeing this error being reported when using the Selenium IDE 1.9.0 with FF 15 (Win). Only other plugin is FireBug. The error is displayed in the IDE log.

    [error] isNewPageLoaded found an old pageLoadError: TypeError: can’t access dead object
    [warn] Stack is: @chrome://selenium-ide/content/selenium-core/scripts/atoms.js:8762 @chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:919 @chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:1080 @chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:1090 @chrome://selenium-ide/content/selenium-core/scripts/selenium-executionloop.js:77 @chrome://selenium-ide/content/selenium-core/scripts/htmlutils.js:60

    1. Andreas wrote on ::

      I have the same error with Selenium IDE 1.10 after an Iframe reloads the current window.

    2. Michael G wrote on :

      I’m seeing a similar error using Selenium IDE 1.9.1 with FF 16.0.2 – I enter information into an iframe, and then when I return to the original window to enter information I get the error. The add-ons I have are Firebug, FireFTP, FirePath, IE Tab 2, Java Console, NoScript, and Selenium IDE. Here is the error:

      [error] isNewPageLoaded found an old pageLoadError: TypeError: can’t access dead object
      [warn] Stack is: @chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:1245 @chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:1223 @chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:955 @chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:1093 @chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:1103 @chrome://selenium-ide/content/selenium-core/scripts/selenium-executionloop.js:77 @chrome://selenium-ide/content/selenium-core/scripts/htmlutils.js:60
      [error] can’t access dead object

    3. Adarshkumar Pavani wrote on :

      Rolling back to Firefox 12.0 fixes the issue

  5. Ray wrote on ::

    I am getting near the same issue with IDE 1.9.1 and FF 17.0:

    [error] isNewPageLoaded found an old pageLoadError: TypeError: can’t access dead object

    [warn] Stack is:
    BrowserBot._handleClosedSubFrame@chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:1245
    BrowserBot.getCurrentWindow@chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:1223
    BrowserBot.pollForLoad@chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:955
    BrowserBot.reschedulePoller/pollerFunction@chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:1093
    BrowserBot.runScheduledPollers@chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:1103
    TestLoop.continueTestWhenConditionIsTrue@chrome://selenium-ide/content/selenium-core/scripts/selenium-executionloop.js:138 .continueTestWhenConditionIsTrue@chrome://selenium-ide/content/selenium-runner.js:133 retval@chrome://selenium-ide/content/selenium-core/scripts/htmlutils.js:60

    [error] can’t access dead object

  6. Fred Thompson wrote on :

    Seeing this with FF17 on Windoze. The window only shows the dead object message. There is nothing to tell the script or line number. Error reporting for add-ons errors should be more explicit.

  7. Ankit Rikhy wrote on :

    Hi is there way by which I can be able to access the dead object in Firefox 16 browser.

    Can any changes be made in the scripts running in the Selenium IDE to overcome this error?

  8. Chuck Hammond wrote on :

    I am getting this same message, no add-on installed yet, just installed Selenium 1.10.0, Message given is as follows

    [info] Executing: |click | link=View Logged Messages | |
    [warn] Link has target ‘_blank’, which is not supported in Selenium! Randomizing target to be: selenium_blank86156
    [info] Executing: |clickAndWait | link=View InterACT Registry Settings | |
    [error] isNewPageLoaded found an old pageLoadError: TypeError: can’t access dead object
    [warn] Stack is: @chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:1245 @chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:1223 @chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:955 @chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:1093 @chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js:1103 @chrome://selenium-ide/content/selenium-core/scripts/selenium-executionloop.js:138 @chrome://selenium-ide/content/selenium-runner.js:133 @chrome://selenium-ide/content/selenium-core/scripts/htmlutils.js:60
    [error] can’t access dead object

  9. MArio wrote on :

    TypeError: can’t access dead object, line: 9 (Error code: -1001) from this iMacro for Firefox (v 19):

    VERSION BUILD=7601105 RECORDER=FX
    TAB T=1
    URL GOTO=https://secure.logmein.com/US/login.asp
    TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:login_pw ATTR=ID:email CONTENT=
    TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:login_pw ATTR=VALUE:LogMeIn
    FRAME NAME=”IFrameInCenterPanel”
    TAG POS=1 TYPE=A ATTR=TXT:
    CLICK X=381 Y=288 CONTENT=
    TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:loginform ATTR=ID:loginButton

  10. Duane Lunday wrote on :

    There needs to be a way to turn this behavior off. Its completely broken the Chickenfoot addon for me. It looks like IMacro and Selenium are having problems with it too.

    There ARE some instances that going back to a newly-dead object would be reasonable. Unit testing, stress testing and data capture, to name a few.

    I understand completely why the change was made, and 98% of the time it would be a good thing. But for those of us who work in browser automation, its completely broken Firefox as a working tool.

    If it could be made a config option, those of us that need the old behavior could still have it, while the 98% could enjoy the benefits of the automatic object removal.

    1. Jorge Villalobos wrote on ::

      This behavior is not going to be reverted. I don’t know the details of how these add-ons are implemented, but I don’t think it’s that hard to make it work. If you want your nodes to continue to be valid after the document is destroyed, you just need to move them to a different doc that continues to be valid. An add-on could have its own hidden doc to move nodes to, so that they are never claimed.

      In the end, it’s up to the developers to work around these problem. The benefits that it has brought in terms of memory usage far outweigh the bugs that were introduced in a few add-ons.

      1. Duane Lunday wrote on :

        Thanks, but I was hoping for an answer that didn’t expect me to plow through 10,000+ lines of javascript in Chickenfoot AND learn the internal functionality of Firefox in order to maintain the usability that I lost due to the change.

        Silly me.

        1. Jorge Villalobos wrote on ::

          Have you contacted the developers about it? There’s nothing I can do about it either.

  11. Dstu wrote on :

    Do you know if we can change something in about:config that disables this situation? The famous “improvement in memory usage” turns to headache for me (selenium user)

    Regards

    1. Jorge Villalobos wrote on ::

      No, it’s not possible to disable it.

      1. Dstu wrote on :

        So, if I need to use Selenium as automation tool, only thing I can do is go back to Firefox 14? Any other alternative?

        Regards,

        1. Jorge Villalobos wrote on ::

          Ideally, the Selenium tool should be updated to avoid these errors, or at least make them non-intrusive. If all else fails, the only solution is to use an old version of Firefox, as you suggest.

  12. Bill wrote on :

    I am just trying to use https://builder.addons.mozilla.org/tutorial/

    using the Add-on Builder tool provided by Mozilla and getting the “can’t access dead object” message complaining about @jetpack.xpi!/bootstrap.js

    resource://gre/modules/XPIProvider.jsm -> jar:file: . . . .

    1. Jorge Villalobos wrote on ::

      So, does this message appear while using the Builder, or after you generate the XPI file and test it?

      1. Junyo wrote on :

        Yes, I have the same problem, and as you said, this message is appear while using the Builder.

        1. david wrote on :

          i get the same error in the same case. Suffering, and so far i googled no solution to it. Plz. help.

          1. systems wrote on :

            true, I’m having the same error while using the builder

            Timestamp: 25/08/2013 23:55:23
            Error: can’t access dead object
            Source File: resource://gre/modules/XPIProvider.jsm -> jar:file:///C:/Users/****/AppData/Roaming/Mozilla/Firefox/Profiles/vkfe8g6h.default/extensions/jid0-TTGvsnboxk0NSPfqD49mnS7MId8@jetpack.xpi!/bootstrap.js -> resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/console/plain-text.js
            Line: 33

            Timestamp: 25/08/2013 23:55:24
            Error: can’t access dead object
            Source File: resource://gre/modules/XPIProvider.jsm -> jar:file:///C:/Users/****/AppData/Roaming/Mozilla/Firefox/Profiles/vkfe8g6h.default/extensions/jid0-TTGvsnboxk0NSPfqD49mnS7MId8@jetpack.xpi!/bootstrap.js -> resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/console/plain-text.js
            Line: 33

      2. Jorge Villalobos wrote on ::

        Can any of you please give me a link to your add-on in the builder so I can give it a look?

        Also, can you please specify if the problem happens only while testing in the builder, or if it still happens when you download the XPI and then install and test it in Firefox?

        1. Roman wrote on ::

          I am trying this simple code at main.js:

          var SS = require(“simple-storage”),
          tabs = require(“tabs”),
          data = require(“self”).data;

          require(“widget”).Widget({
          id: “Advancio”,
          label: “Wikipedia Advanced”,
          contentURL: data.url(“Icon-16.png”),
          onClick: function( event ) {
          //
          }
          });

          tabs.on(“ready”, function (tab) {
          //delete SS.storage.test_ss;
          console.log(‘init storage’);
          SS.storage.test_ss = ‘test';

          });


          Error happens in both cases (builder, xpi).

          1. Jorge Villalobos wrote on ::

            That sounds like a bug in the SDK. I would recommend in this case to post about it in the SDK forums, either here or here.

  13. Ian Nartowicz wrote on :

    This change also breaks perfectly legitimate, non-leaking, code. Although perhaps not good practice, it used to be possible to temporarily hold onto results from, for example, an iframe document, and process these after the iframe was gone. No longer. Time to get re-coding :(