TypeError: this._browser is null

RESOLVED FIXED in 1.14

Status

Add-on SDK
General
P2
normal
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: erikvold, Assigned: ochameau)

Tracking

unspecified
1.14
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

When I run `cfx test -v` I see the following output quite a bit:

TypeError: this._browser is null
resource://a941fec9-6704-4eef-8185-e6ebce6a6439-at-jetpack/addon-sdk/lib/sdk/tabs/tab-firefox.js 50
Traceback (most recent call last):
  File "chrome://browser/content/browser.xul", line 1, in onselect
    <?xml version="1.0"?>
  File "chrome://browser/content/tabbrowser.xml", line 949, in updateCurrentBrowser
    this.mCurrentTab.dispatchEvent(event);
  File "resource://a941fec9-6704-4eef-8185-e6ebce6a6439-at-jetpack/addon-sdk/lib/sdk/tabs/observer.js", line 49, in handleEvent
    this._emit(EVENTS[event.type], event.target, event);
  File "resource://a941fec9-6704-4eef-8185-e6ebce6a6439-at-jetpack/addon-sdk/lib/sdk/deprecated/events.js", line 123, in _emit
    return this._emitOnObject.apply(this, args);
  File "resource://a941fec9-6704-4eef-8185-e6ebce6a6439-at-jetpack/addon-sdk/lib/sdk/deprecated/events.js", line 153, in _emitOnObject
    listener.apply(targetObj, params);
  File "resource://a941fec9-6704-4eef-8185-e6ebce6a6439-at-jetpack/addon-sdk/lib/sdk/tabs/observer.js", line 60, in onTabSelect
    if (selectedTab) observer._emit('deactivate', selectedTab);
  File "resource://a941fec9-6704-4eef-8185-e6ebce6a6439-at-jetpack/addon-sdk/lib/sdk/deprecated/events.js", line 123, in _emit
    return this._emitOnObject.apply(this, args);
  File "resource://a941fec9-6704-4eef-8185-e6ebce6a6439-at-jetpack/addon-sdk/lib/sdk/deprecated/events.js", line 153, in _emitOnObject
    listener.apply(targetObj, params);
  File "resource://a941fec9-6704-4eef-8185-e6ebce6a6439-at-jetpack/addon-sdk/lib/sdk/windows/tabs-firefox.js", line 99, in _onTabEvent
    let wrappedTab = Tab(options);
  File "resource://a941fec9-6704-4eef-8185-e6ebce6a6439-at-jetpack/addon-sdk/lib/sdk/tabs/tab-firefox.js", line 230, in Tab
    let tab = TabTrait(options);
  File "resource://a941fec9-6704-4eef-8185-e6ebce6a6439-at-jetpack/addon-sdk/lib/sdk/deprecated/traits.js", line 114, in Trait
    return self.constructor.apply(self, arguments) || self._public;
  File "resource://a941fec9-6704-4eef-8185-e6ebce6a6439-at-jetpack/addon-sdk/lib/sdk/tabs/tab-firefox.js", line 50, in Tab
    this._browser.addEventListener(EVENTS.ready.dom, this._onReady, true);
"]
info: addon-sdk: [JavaScript Error: "addon-sdk: An exception occurred.
TypeError: this._browser is null
resource://a941fec9-6704-4eef-8185-e6ebce6a6439-at-jetpack/addon-sdk/lib/sdk/tabs/tab-firefox.js 50
Traceback (most recent call last):
  File "chrome://browser/content/browser.xul", line
Blocks: 838983
If this is actually causing test failures, feel free to bump it up to P1.
Priority: -- → P2
(In reply to Wes Kocher (:KWierso) from comment #1)
> If this is actually causing test failures, feel free to bump it up to P1.

It's not which is worrying..
Actually I would say that the fact that the tests are not failing even if we have exceptions in tests, should be worthy to bump it to P1. For this such exception I would expect to don't have the tree green.
Alex can you take a look at this one? I think it may be important for 1.14
Flags: needinfo?(poirot.alex)
Target Milestone: --- → 1.14
(Assignee)

Comment 5

5 years ago
Created attachment 721636 [details]
Pull request 838

Wasn't an easy one... We are facing race conditions between concurrent tabs module instances loaded in different loaders...
(Each test-* file is now executed in its own loader instance)
Assignee: nobody → poirot.alex
Attachment #721636 - Flags: review?(evold)
Flags: needinfo?(poirot.alex)
(Assignee)

Comment 6

5 years ago
Knowing what was behind these exception was important,
but I'm not sure the actual issue is serious enough to be pushed to stabilization?

It isn't only test issue, but it only happen when a tab is removed during onOpen event and multiple addons are using tabs API. It won't fail if the tab is removed during onReady event, the race only happen with actions being done during TabOpen.
Attachment #721636 - Flags: review?(evold) → review?(rFobic)
Attachment #721636 - Flags: review?(rFobic) → review+

Comment 7

5 years ago
Commits pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/8ce14bdf76c38a13853fbb9bbbda782605685255
Bug 843500: Fix race condition in firefox tabs code between concurrent module instances.

https://github.com/mozilla/addon-sdk/commit/ea266834f3c3243dfd0a5f680988b2f3fa7477a8
Merge pull request #838 from ochameau/tabevents-race

Bug 843500: Fix race condition in firefox tabs code between concurrent module instances. r=mossop
(Assignee)

Updated

5 years ago
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED

Comment 8

5 years ago
Commit pushed to stabilization at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/5da62e41172c9a46726c5a072b9e5538bf6e4889
Merge pull request #838 from ochameau/tabevents-race

Bug 843500: Fix race condition in firefox tabs code between concurrent module instances. r=mossop(cherry picked from commit ea266834f3c3243dfd0a5f680988b2f3fa7477a8)
Blocks: 852338
You need to log in before you can comment on or make changes to this bug.