Closed Bug 706657 Opened 14 years ago Closed 14 years ago

java.lang.NullPointerException @ TabsTray$TabsAdapter$2.onClick(TabsTray.java:246)

Categories

(Firefox for Android Graveyard :: General, defect, P3)

ARM
Android
defect

Tracking

(fennec11+)

RESOLVED WORKSFORME
Tracking Status
fennec 11+ ---

People

(Reporter: aaronmt, Assigned: sriram)

Details

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

Attachments

(1 file)

I/ActivityManager( 110): Displayed org.mozilla.fennec/org.mozilla.gecko.TabsTray: +324ms I/dalvikvm( 2916): Total arena pages for JIT: 11 I/GeckoApp( 2724): Got message: Tab:Selected I/GeckoApp( 2724): Switched to tab: 7 D/dalvikvm( 2724): GC_EXTERNAL_ALLOC freed 334K, 55% free 3526K/7815K, external 13443K/15017K, paused 51ms I/GeckoDoorHangerPopup( 2724): Showing all doorhangers for tab: 7 I/GeckoApp( 2724): Got message: Tab:Closed I/GeckoApp( 2724): Destroyed a tab I/GeckoTabs( 2724): Removed a tab with id: 8 I/GeckoDoorHangerPopup( 2724): Showing all doorhangers for tab: 7 E/GeckoApp( 2724): top level exception E/GeckoApp( 2724): java.lang.NullPointerException E/GeckoApp( 2724): at org.mozilla.gecko.TabsTray$TabsAdapter$2.onClick(TabsTray.java:246) E/GeckoApp( 2724): at android.view.View.performClick(View.java:2485) E/GeckoApp( 2724): at android.view.View$PerformClick.run(View.java:9080) E/GeckoApp( 2724): at android.os.Handler.handleCallback(Handler.java:587) E/GeckoApp( 2724): at android.os.Handler.dispatchMessage(Handler.java:92) E/GeckoApp( 2724): at android.os.Looper.loop(Looper.java:130) E/GeckoApp( 2724): at org.mozilla.gecko.GeckoApp$24.run(GeckoApp.java:1333) E/GeckoApp( 2724): at android.os.Handler.handleCallback(Handler.java:587) E/GeckoApp( 2724): at android.os.Handler.dispatchMessage(Handler.java:92) E/GeckoApp( 2724): at android.os.Looper.loop(Looper.java:130) E/GeckoApp( 2724): at android.app.ActivityThread.main(ActivityThread.java:3683) E/GeckoApp( 2724): at java.lang.reflect.Method.invokeNative(Native Method) E/GeckoApp( 2724): at java.lang.reflect.Method.invoke(Method.java:507) E/GeckoApp( 2724): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) E/GeckoApp( 2724): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) E/GeckoApp( 2724): at dalvik.system.NativeStart.main(Native Method) This happened at some point in closing a tab; don't have all the STR. -- Samsung Nexus S (Android 2.3.6) 20111130112926 http://hg.mozilla.org/projects/birch/rev/f605f17ba73d
Assignee: nobody → sriram
Attached patch PatchSplinter Review
This patch adds a preventive check while accessing tabs.
Attachment #578117 - Flags: review?(mark.finkle)
Comment on attachment 578117 [details] [diff] [review] Patch > Tab tab = tabs.getTab(tabId); > > if (tabs.isSelectedTab(tab)) { > int index = tabs.getIndexOf(tab); > if (index >= 1) > index--; > else > index = 1; >- int id = tabs.getTabAt(index).getId(); >- GeckoAppShell.sendEventToGecko(new GeckoEvent("Tab:Select", String.valueOf(id))); >+ >+ Tab nextTab = tabs.getTabAt(index); >+ if (nextTab != null) { >+ int id = nextTab.getId(); >+ GeckoAppShell.sendEventToGecko(new GeckoEvent("Tab:Select", String.valueOf(id))); >+ } >+ > GeckoAppShell.sendEventToGecko(new GeckoEvent("Tab:Close", v.getTag().toString())); > } else { Just trying to figure this out a bit: * If the tab we are closing is the selected tab, we check the current tab index * if greater than or equal to 1, select the next lower tab in the list * if equal to 0 use the tab at index 1 (technically the index could be -1 but the tab must exist since we just checked if it was selected. The tab at the nextTab index might not exist! How can that be? We must be missing a race condition here somewhere. * I don't like separating the Tab:Select and Tab:Close. That might lead to a situation where there is not tab selected in browser.js Can we add more logging to see what the cause of the race could be?
Attachment #578117 - Flags: review?(mark.finkle) → review-
Bug 701884 is probably related.
Priority: -- → P3
tracking-fennec: --- → 11+
Aaron - Can you still repro this?
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
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: