Closed Bug 837426 Opened 13 years ago Closed 9 years ago

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

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
critical

Tracking

(firefox20 affected, firefox21 affected)

RESOLVED INCOMPLETE
Tracking Status
firefox20 --- affected
firefox21 --- affected

People

(Reporter: scoobidiver, Unassigned)

Details

(Keywords: crash, Whiteboard: [native-crash])

Crash Data

There are one crash in 20.0a2 and one crash in 21.0a1: bp-8f159d03-e813-4309-93fc-007a92130202. java.lang.NullPointerException at org.mozilla.gecko.TabsTray$TabsAdapter.getView(TabsTray.java:263) at android.widget.AbsListView.obtainView(AbsListView.java:2033) at android.widget.ListView.makeAndAddView(ListView.java:1772) at android.widget.ListView.fillUp(ListView.java:705) at android.widget.ListView.fillGap(ListView.java:645) at android.widget.AbsListView.trackMotionScroll(AbsListView.java:4546) at android.widget.AbsListView.scrollIfNeeded(AbsListView.java:2852) at android.widget.AbsListView.onTouchEvent(AbsListView.java:3106) at android.view.View.dispatchTouchEvent(View.java:5545) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1951) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1712) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:1957) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1726) at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1912) at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1371) at android.app.Activity.dispatchTouchEvent(Activity.java:2391) at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1860) at android.view.View.dispatchPointerEvent(View.java:5725) at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:2928) at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2492) at android.view.ViewRootImpl.processInputEvents(ViewRootImpl.java:870) at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2501) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4424) 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:784) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) at dalvik.system.NativeStart.main(Native Method) More reports at: https://crash-stats.mozilla.com/report/list?signature=java.lang.NullPointerException%3A+at+org.mozilla.gecko.TabsTray%24TabsAdapter.getView%28TabsTray.java%29
Sriram, TabsAdapter.mTabs is null here. Is this a race condition when closing tabs or shutting down? https://hg.mozilla.org/mozilla-central/annotate/2360c3c46aca/mobile/android/base/TabsTray.java#l263
We seem to be null checking mTabs in other places in the file, even setting mTabs = null in clear. Do we need to null check in getView() ? What would the correct action be in that case? Skip the assignValues call? Check at the top of getView and return null (seems like a bad idea)? getItem is not protected either: https://hg.mozilla.org/mozilla-central/annotate/2360c3c46aca/mobile/android/base/TabsTray.java#l208
The case where this could happen is, "there are 10 tabs, the tabs tray is opened, and closed swiftly". In this case, we start rendering tab rows, and then a hide() is called which clears the data. I guess we need to lock on mTabs. getView() will be called only if getCount() returns a positive value. And between getCount() and getView(), we are calling hide() (but how? hide() is not running on UI thread??). If we ensure hide() is called on UI thread, we won't have a problem here I guess.
Is there any STR?
Crash Signature: [@ java.lang.NullPointerException: at org.mozilla.gecko.TabsTray$TabsAdapter.getView(TabsTray.java)] → [@ java.lang.NullPointerException: at org.mozilla.gecko.TabsTray$TabsAdapter.getView(TabsTray.java)] [@ java.lang.NullPointerException: at org.mozilla.gecko.TabsTray$TabsAdapter.getView]
Crash signature does not show up on crash-stats any more.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.