masenf / wta-next-bus

Python Wrapper / Android Application for accessing Whatcom Transit bus schedules
2 stars 1 forks source link

NullPointerException in the wild #6

Open masenf opened 11 years ago

masenf commented 11 years ago

I'm guessing this is what is happening, haven't seen this in the debugger yet.

When the app has been open on the Next Bus tab for a while, then get garbage collected, then gets resumed, it takes a while to start and crashes. I'm assuming it's a NullPointerEx that is being caused by extremely shoddy coding in how the active stop is saved and accessed.

masenf commented 11 years ago

See selected_stop, selected_location in WtaActivity.java

masenf commented 11 years ago

03-20 21:01:57.400: D/StateSavingFragment(10179): onCreate() - storing instanceState in class 03-20 21:01:57.400: V/StateSavingFragment(10179): onActivityCreated() - retrieving globalState 03-20 21:01:57.400: V/StateSavingFragment(10179): onActivityCreated() - retrieving instanceState 03-20 21:01:57.410: D/StateSavingFragment(10179): onCreate() - storing instanceState in class 03-20 21:01:57.410: V/StateSavingFragment(10179): onActivityCreated() - retrieving globalState 03-20 21:01:57.410: V/StateSavingFragment(10179): onActivityCreated() - retrieving instanceState 03-20 21:01:57.470: V/ProgressActivity(10179): onCreate() - attempting to initialize ProgressManager 03-20 21:01:57.470: D/TabNavActivity(10179): onCreate() - TabNavActivity created 03-20 21:01:57.470: D/WtaActivity(10179): onCreate() - creating actionbar tabs 03-20 21:01:57.470: V/GenericTabListener(10179): onTabSelected() - reattaching com.masenf.wtaandroid.fragment.FavoritesFragment 03-20 21:01:57.480: V/GenericTabListener(10179): onTabUnselected() - detaching com.masenf.wtaandroid.fragment.FavoritesFragment 03-20 21:01:57.480: V/GenericTabListener(10179): onTabSelected() - reattaching com.masenf.wtaandroid.fragment.NextBusFragment 03-20 21:01:57.480: V/ProgressFragment(10179): onCreateView() - inflating layout 03-20 21:01:57.480: D/WtaFragment(10179): onCreateView() - inflating layout id=2130903043 03-20 21:01:57.500: D/AbsListView(10179): Get MotionRecognitionManager 03-20 21:01:57.500: D/WtaFragment(10179): onViewCreated() - captured ListView, lv = android.widget.ListView@4220a718 for com.masenf.wtaandroid.fragment.NextBusFragment 03-20 21:01:57.500: D/WtaFragment(10179): onCreateView() - inflating layout id=2130903041 03-20 21:01:57.500: D/AbsListView(10179): Get MotionRecognitionManager 03-20 21:01:57.500: D/WtaFragment(10179): onViewCreated() - captured ListView, lv = android.widget.ListView@4220d438 for com.masenf.wtaandroid.fragment.FavoritesFragment 03-20 21:01:57.500: V/ProgressManager(10179): setProgressFragment(ProgressFragment{421d94b0 #1 id=0x7f07000b GlobalProgress}) 03-20 21:01:57.510: D/NextBusFragment(10179): onResume() - initializing list adapter and restoring values 03-20 21:01:57.510: V/NextBusFragment(10179): onResume() - TimesListAdapter ad is null, creating new instance 03-20 21:01:57.510: V/ProgressReportingTask(10179): onPreExecute() for com.masenf.core.async.DataReadTask 03-20 21:01:57.510: V/ProgressManager(10179): createProgressCallback() for 5c1adc29-6959-4c26-95f1-d9020aa2c8d5 03-20 21:01:57.510: I/ProgressItem(10179): startProgress() - view not created yet, postponing start 03-20 21:01:57.510: V/ProgressItem(10179): onProgress() posted status update for 5c1adc29-6959-4c26-95f1-d9020aa2c8d5 03-20 21:01:57.510: I/ProgressItem(10179): setProgress() - view not created yet, postponing update 03-20 21:01:57.510: D/NextBusFragment(10179): updateStopInfoViews() - stop_id_label = 3077, location_label = Northbound HIGH ST AT WWU HAGGARD HALL 03-20 21:01:57.530: V/WtaDatastore(10179): Is 3077 tagged with 'Favorites' ?? 03-20 21:01:57.530: V/ProgressItem(10179): onProgress() posted status update for 5c1adc29-6959-4c26-95f1-d9020aa2c8d5 03-20 21:01:57.530: I/ProgressItem(10179): startProgress() - view not created yet, postponing start 03-20 21:01:57.540: V/(10179): 3077 is a favorite 03-20 21:01:57.581: D/libEGL(10179): loaded /system/lib/egl/libEGL_adreno200.so 03-20 21:01:57.591: D/libEGL(10179): loaded /system/lib/egl/libGLESv1_CM_adreno200.so 03-20 21:01:57.591: D/libEGL(10179): loaded /system/lib/egl/libGLESv2_adreno200.so 03-20 21:01:57.621: I/Adreno200-EGLSUB(10179): ConfigWindowMatch:2087: Format RGBA_8888. 03-20 21:01:57.641: E/(10179): s3dReadConfigFile:75: Can't open file for reading 03-20 21:01:57.641: E/(10179): s3dReadConfigFile:75: Can't open file for reading 03-20 21:01:57.641: D/OpenGLRenderer(10179): Enabling debug mode 0 03-20 21:01:57.651: V/ProgressItem(10179): onProgress() posted status update for 5c1adc29-6959-4c26-95f1-d9020aa2c8d5 03-20 21:01:57.651: I/ProgressItem(10179): setProgress() - view not created yet, postponing update 03-20 21:01:57.651: I/ProgressItem(10179): updateStatus() - view not created yet, postponing message 03-20 21:01:57.651: V/NextBusFragment(10179): isFavorite? fav_label = Remove Favorite 03-20 21:01:57.651: V/ProgressReportingTask(10179): onPostExecute() for com.masenf.core.async.DataReadTask 03-20 21:01:57.991: V/ProgressManager(10179): expireProgress() 5c1adc29-6959-4c26-95f1-d9020aa2c8d5 has completed, removing it from list 03-20 21:01:57.991: V/ProgressFragment(10179): onExpireItem() - removing 5c1adc29-6959-4c26-95f1-d9020aa2c8d5 from the view 03-20 21:02:01.755: V/GenericTabListener(10179): onTabUnselected() - detaching com.masenf.wtaandroid.fragment.NextBusFragment 03-20 21:02:01.755: V/GenericTabListener(10179): onTabSelected() - reattaching com.masenf.wtaandroid.fragment.FavoritesFragment 03-20 21:02:01.775: D/WtaFragment(10179): onCreateView() - inflating layout id=2130903041 03-20 21:02:01.775: D/AbsListView(10179): Get MotionRecognitionManager 03-20 21:02:01.775: D/WtaFragment(10179): onViewCreated() - captured ListView, lv = android.widget.ListView@42226170 for com.masenf.wtaandroid.fragment.FavoritesFragment 03-20 21:02:01.775: D/BrowseFragment(10179): onResume() - initializing list adapter and restoring values for com.masenf.wtaandroid.fragment.FavoritesFragment 03-20 21:02:01.775: V/BrowseFragment(10179): onResume() - ad BaseTaskListAdapter is null, creating new instance 03-20 21:02:01.775: V/BrowseFragment(10179): onResume() - nTm NestedTagManaer is null, creating new instance for Favorites 03-20 21:02:01.785: V/NestedTagManager(10179): Instantiating new Stack for com.masenf.wtaandroid.NestedTagManager 03-20 21:02:01.795: D/BrowseFragment(10179): onResume() - Deserializing stack_state from stack_state for com.masenf.wtaandroid.fragment.FavoritesFragment 03-20 21:02:01.795: D/AndroidRuntime(10179): Shutting down VM 03-20 21:02:01.795: W/dalvikvm(10179): threadid=1: thread exiting with uncaught exception (group=0x4154f438) 03-20 21:02:01.805: E/AndroidRuntime(10179): FATAL EXCEPTION: main 03-20 21:02:01.805: E/AndroidRuntime(10179): java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.Stack 03-20 21:02:01.805: E/AndroidRuntime(10179): at com.masenf.wtaandroid.NestedTagManager.restoreStackState(NestedTagManager.java:150) 03-20 21:02:01.805: E/AndroidRuntime(10179): at com.masenf.wtaandroid.fragment.BrowseFragment.onResume(BrowseFragment.java:70) 03-20 21:02:01.805: E/AndroidRuntime(10179): at com.masenf.wtaandroid.fragment.FavoritesFragment.onResume(FavoritesFragment.java:12) 03-20 21:02:01.805: E/AndroidRuntime(10179): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:874) 03-20 21:02:01.805: E/AndroidRuntime(10179): at android.app.FragmentManagerImpl.attachFragment(FragmentManager.java:1217) 03-20 21:02:01.805: E/AndroidRuntime(10179): at android.app.BackStackRecord.run(BackStackRecord.java:625) 03-20 21:02:01.805: E/AndroidRuntime(10179): at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1397) 03-20 21:02:01.805: E/AndroidRuntime(10179): at android.app.FragmentManagerImpl$1.run(FragmentManager.java:426) 03-20 21:02:01.805: E/AndroidRuntime(10179): at android.os.Handler.handleCallback(Handler.java:615) 03-20 21:02:01.805: E/AndroidRuntime(10179): at android.os.Handler.dispatchMessage(Handler.java:92) 03-20 21:02:01.805: E/AndroidRuntime(10179): at android.os.Looper.loop(Looper.java:137) 03-20 21:02:01.805: E/AndroidRuntime(10179): at android.app.ActivityThread.main(ActivityThread.java:4918) 03-20 21:02:01.805: E/AndroidRuntime(10179): at java.lang.reflect.Method.invokeNative(Native Method) 03-20 21:02:01.805: E/AndroidRuntime(10179): at java.lang.reflect.Method.invoke(Method.java:511) 03-20 21:02:01.805: E/AndroidRuntime(10179): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004) 03-20 21:02:01.805: E/AndroidRuntime(10179): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771) 03-20 21:02:01.805: E/AndroidRuntime(10179): at dalvik.system.NativeStart.main(Native Method)

masenf commented 11 years ago

Looks like my serialized Stack is turning into an ArrayList somewhere. Can't reproduce while the application is running. It seems to be when the app gets swapped out of active memory.