Closed Bug 824474 Opened 7 years ago Closed 7 years ago

java.lang.NullPointerException: at org.mozilla.gecko.TabsTray$TabsAdapter.removeTab(TabsTray.java)

Categories

(Firefox for Android :: General, defect, critical)

All
Android
defect
Not set
critical

Tracking

()

RESOLVED FIXED
Firefox 20
Tracking Status
firefox20 + fixed

People

(Reporter: kairo, Assigned: sriram)

References

Details

(Keywords: crash)

Crash Data

Attachments

(1 file)

This bug was filed from the Socorro interface and is 
report bp-8c9e288b-4e4c-4dc1-b2c5-96c6e2121223 .
============================================================= 

Java exception message:

java.lang.NullPointerException
	at org.mozilla.gecko.TabsTray$TabsAdapter.removeTab(TabsTray.java:226)
	at org.mozilla.gecko.TabsTray$TabsAdapter.onTabChanged(TabsTray.java:156)
	at org.mozilla.gecko.Tabs$5.run(Tabs.java:374)
	at android.app.Activity.runOnUiThread(Activity.java:4170)
	at org.mozilla.gecko.Tabs.notifyListeners(Tabs.java:365)
	at org.mozilla.gecko.Tabs.notifyListeners(Tabs.java:361)
	at org.mozilla.gecko.Tab.onDestroy(Tab.java:110)
	at org.mozilla.gecko.Tabs.closeTab(Tabs.java:179)
	at org.mozilla.gecko.Tabs.closeTab(Tabs.java:163)
	at org.mozilla.gecko.TabsTray$3.onPropertyAnimationEnd(TabsTray.java:326)
	at org.mozilla.gecko.PropertyAnimator.stop(PropertyAnimator.java:158)
	at org.mozilla.gecko.PropertyAnimator.run(PropertyAnimator.java:96)
	at android.os.Handler.handleCallback(Handler.java:605)
	at android.os.Handler.dispatchMessage(Handler.java:92)
	at android.os.Looper.loop(Looper.java:137)
	at android.app.ActivityThread.main(ActivityThread.java:4514)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:511)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
	at dalvik.system.NativeStart.main(Native Method)

This started happening in 20.0a1 trunk on 2012-12-23.

Find more reports at https://crash-stats.mozilla.com/report/list?signature=java.lang.NullPointerException%3A%20at%20org.mozilla.gecko.TabsTray%24TabsAdapter.removeTab%28TabsTray.java%29
Assignee: nobody → sriram
Blocks: 817706
Happened to me as I closed a tab (I had a couple open at the time).
I saw this myself today with the same scenario as comment 1, this is by far the top crash atm, and solely responsible for the high crash rate on Nightly.
Is there any STR for this?
I don't have STR but I hit this more than once a day during normal browsing (I know, that doesn't help at all!).
And it's always when closing a tab when I have say around 4 or more tabs open.
I just reproduced it. Should fix it soon. Stay tuned. :D
Attached patch PatchSplinter Review
Some of the cases when this crashes could happen are:
1. Precondition: There is one normal tab and the tabs-tray is opened at least once. Open a private tab and open the tabs-tray. Now try closing the only private tab. This will crash, as we try to "hide()" the normal tabs. 
Fix: This is fixed in TabsPanel.java where we hide the previously switched tab contents, when we switch tabs.

2. Close the only available private tab. This closes the tabs-tray and informs Tabs not to send any more tab-changes. At this point, there could be a race where Tabs sends a notification for the closed tab and our adapter's tab-list is null.
Fix: Remove it from the adapter's list only it is not null.
Attachment #695821 - Flags: review?(mark.finkle)
Attachment #695821 - Flags: review?(mark.finkle) → review+
Assuming the other bug 824354 is a dupe
Duplicate of this bug: 824354
Sweet!  Thanks, Sriram.  This bug has caused Nightly to skyrocket in crashes.
https://hg.mozilla.org/mozilla-central/rev/8f5e2129e89d
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20
You need to log in before you can comment on or make changes to this bug.