Closed Bug 749624 Opened 12 years ago Closed 12 years ago

Sites don't load, logcat says BrowserApp.selectedTab is null

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(firefox14 fixed, blocking-fennec1.0 +)

RESOLVED FIXED
Firefox 15
Tracking Status
firefox14 --- fixed
blocking-fennec1.0 --- +

People

(Reporter: johnath, Assigned: Margaret)

References

Details

Attachments

(2 files)

Attached file logcat
I occassionally get into a state where pages won't load (which, I realize, sounds like bug 705558 RESO WFM). The throbber spins, the awesomescreen is responsive, but no content ever loads. logcat says:

JavaScript Error: "TypeError: BrowserApp.selectedTab is null" {file: "chrome://browser/content/browser.js" line: 4619}

Showed Margaret during work week, she agreed it was worth filing, though it might be dup'd by work sriram was doing.

More logcat attached.

Nom'ng because failure-to-load is a big problem, though I don't have any STR so it might be tough to QA.
blocking-fennec1.0: --- → ?
This looks like code introduced by bug 736311.

Is it possible there's a legitimate state where we're calling this observer when BrowserApp.selectedTab is null? It looks like throwing a null check in there would fix the problem, but we should make sure this isn't part of a bigger issue.
Blocks: 736311
Assignee: nobody → margaret.leibovic
> This looks like code introduced by bug 736311.

How, exactly?  I don't see us modifying the value of selectedTab in that patch.

https://hg.mozilla.org/mozilla-central/rev/0bc32fccce4c
(In reply to Justin Lebar [:jlebar] from comment #2)
> > This looks like code introduced by bug 736311.
> 
> How, exactly?  I don't see us modifying the value of selectedTab in that
> patch.
> 
> https://hg.mozilla.org/mozilla-central/rev/0bc32fccce4c

The problem isn't that we're modifying it, the problem is that we're assuming it's not null in this observer:
http://mxr.mozilla.org/mozilla-central/source/mobile/android/chrome/content/browser.js#4749

If it is null, we get an error and the JS side of the app dies.
Please see bug 749149 for my STR if needed.
(In reply to Johnathan Nightingale [:johnath] from comment #0)
> Showed Margaret during work week, she agreed it was worth filing, though it
> might be dup'd by work sriram was doing.

Definitely worth filing - this could drive users back to stock.
Attached patch patchSplinter Review
Looking more closely at the log, this happened right after startup. We fire the application-foreground notification on ACTIVITY_START [1], so it's totally possible to get into a case where we observe that before setting up a selected tab. Therefore, this null check seems like a safe way to go.

[1] http://mxr.mozilla.org/mozilla-central/source/widget/android/nsAppShell.cpp#431
Attachment #619114 - Flags: review?(mark.finkle)
blocking-fennec1.0: ? → +
Comment on attachment 619114 [details] [diff] [review]
patch

With all the "BrowserApp.selectedTab" usage can you create a local variable?

let browser = BrowserApp.selectedTab;
if (browser && browser.getActive() != isForeground)
  browser.setActive(isForeground);
Attachment #619114 - Flags: review?(mark.finkle) → review+
I used |tab| instead of |browser|, since that's a better variable name.

https://hg.mozilla.org/integration/mozilla-inbound/rev/8352ac30ddcd
OS: Mac OS X → Android
Hardware: x86 → ARM
Target Milestone: --- → Firefox 15
Comment on attachment 619114 [details] [diff] [review]
patch

[Approval Request Comment]
Regression caused by (bug #): bug 736311
User impact if declined: you can get into a state where the gecko side of the app dies
Testing completed (on m-c, etc.): just landed on inbound
Risk to taking this patch (and alternatives if risky): low risk (just add a null check)
String changes made by this patch: n/a
Attachment #619114 - Flags: approval-mozilla-aurora?
Running into this with a debug build this morning
Keywords: checkin-needed
(In reply to Aaron Train [:aaronmt] from comment #12)
> Running into this with a debug build this morning

What tree? This already landed on inbound.
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/8352ac30ddcd
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Comment on attachment 619114 [details] [diff] [review]
patch

Mobile only.
Attachment #619114 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: