n76 / DejaVu

Yet another network location backend for the UnifiedNLP/microG project
GNU General Public License v3.0
100 stars 18 forks source link

Repeated crashes with some apps #16

Closed Dr-Cool closed 6 years ago

Dr-Cool commented 6 years ago

DejaVu repeatedly crashes with a few apps that use location (but not all apps that use location). Here are segments of the event log:

03-05 00:48:33.596 I/am_crash( 2207): [5205,0,org.fitchfamily.android.dejavu,952680004,java.lang.NullPointerException,Attempt to invoke virtual method 'org.fitchfamily.android.dejavu.RfEmitter org.fitchfamily.android.dejavu.Database.getEmitter(org.fitchfamily.android.dejavu.RfIdentification)' on a null object reference,Cache.java,106]

03-05 01:20:37.514 I/am_crash( 2207): [10908,0,org.fitchfamily.android.dejavu,952680004,java.lang.NullPointerException,Attempt to invoke virtual method 'org.fitchfamily.android.dejavu.RfEmitter org.fitchfamily.android.dejavu.Database.getEmitter(org.fitchfamily.android.dejavu.RfIdentification)' on a null object reference,Cache.java,106] 03-05 01:20:39.576 I/am_proc_died( 2207): [0,10908,org.fitchfamily.android.dejavu] 03-05 01:20:39.688 I/sf_frame_dur( 288): [Application Error: org.fitchfamily.android.dejavu,11,1,0,1,0,2,0] 03-05 01:20:42.199 I/am_proc_start( 2207): [0,22144,10167,org.fitchfamily.android.dejavu,service,org.fitchfamily.android.dejavu/.BackendService] 03-05 01:20:42.336 I/am_proc_bound( 2207): [0,22144,org.fitchfamily.android.dejavu]

Dr-Cool commented 6 years ago

Here the logcat log equivalent of the crashes shown above:

03-05 00:48:33.592 E/AndroidRuntime( 5205): FATAL EXCEPTION: Thread-352 03-05 00:48:33.592 E/AndroidRuntime( 5205): Process: org.fitchfamily.android.dejavu, PID: 5205 03-05 00:48:33.592 E/AndroidRuntime( 5205): java.lang.NullPointerException: Attempt to invoke virtual method 'org.fitchfamily.android.dejavu.RfEmitter org.fitchfamily.android.dejavu.Database.getEmitter(org.fitchfamily.android.dejavu.RfIdentification)' on a null object reference 03-05 00:48:33.592 E/AndroidRuntime( 5205): at org.fitchfamily.android.dejavu.Cache.get(Cache.java:106) 03-05 00:48:33.592 E/AndroidRuntime( 5205): at org.fitchfamily.android.dejavu.BackendService.endOfPeriodProcessing(BackendService.java:945) 03-05 00:48:33.592 E/AndroidRuntime( 5205): at org.fitchfamily.android.dejavu.BackendService.backgroundProcessing(BackendService.java:727) 03-05 00:48:33.592 E/AndroidRuntime( 5205): at org.fitchfamily.android.dejavu.BackendService.access$300(BackendService.java:71) 03-05 00:48:33.592 E/AndroidRuntime( 5205): at org.fitchfamily.android.dejavu.BackendService$4.run(BackendService.java:668) 03-05 00:48:33.592 E/AndroidRuntime( 5205): at java.lang.Thread.run(Thread.java:818) 03-05 00:48:33.735 I/ActivityManager( 2207): Start proc 4287:org.fdroid.fdroid/u0a74 for broadcast org.fdroid.fdroid/.receiver.WifiStateChangeReceiver 03-05 00:48:33.828 D/ConnectivityService( 2207): notifyType CAP_CHANGED for NetworkAgentInfo [WIFI () - 129] 03-05 00:48:33.829 D/ConnectivityService( 2207): updateNetworkScore for NetworkAgentInfo [WIFI () - 129] to 56 03-05 00:48:34.473 D/WifiService( 2207): New client listening to asynchronous messages 03-05 00:48:35.000 I/ActivityManager( 2207): Killing 1389:com.synology.dsphoto/u0a86 (adj 15): empty for 2093s 03-05 00:48:35.078 D/ActivityManager( 2207): cleanUpApplicationRecord -- 1389 03-05 00:48:35.645 D/WifiService( 2207): Client connection lost with reason: 4 03-05 00:48:35.658 W/InputMethodManagerService( 2207): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@41ebea4 attribute=null, token = android.os.BinderProxy@d126cc6 03-05 00:48:35.708 I/ActivityManager( 2207): Process org.fitchfamily.android.dejavu (pid 5205) has died

03-05 01:20:37.504 D/DejaVu GpsMonitor(10908): onDestroy() 03-05 01:20:37.513 E/AndroidRuntime(10908): FATAL EXCEPTION: Thread-1581 03-05 01:20:37.513 E/AndroidRuntime(10908): Process: org.fitchfamily.android.dejavu, PID: 10908 03-05 01:20:37.513 E/AndroidRuntime(10908): java.lang.NullPointerException: Attempt to invoke virtual method 'org.fitchfamily.android.dejavu.RfEmitter org.fitchfamily.android.dejavu.Database.getEmitter(org.fitchfamily.android.dejavu.RfIdentification)' on a null object reference 03-05 01:20:37.513 E/AndroidRuntime(10908): at org.fitchfamily.android.dejavu.Cache.get(Cache.java:106) 03-05 01:20:37.513 E/AndroidRuntime(10908): at org.fitchfamily.android.dejavu.BackendService.endOfPeriodProcessing(BackendService.java:945) 03-05 01:20:37.513 E/AndroidRuntime(10908): at org.fitchfamily.android.dejavu.BackendService.backgroundProcessing(BackendService.java:727) 03-05 01:20:37.513 E/AndroidRuntime(10908): at org.fitchfamily.android.dejavu.BackendService.access$300(BackendService.java:71) 03-05 01:20:37.513 E/AndroidRuntime(10908): at org.fitchfamily.android.dejavu.BackendService$4.run(BackendService.java:668) 03-05 01:20:37.513 E/AndroidRuntime(10908): at java.lang.Thread.run(Thread.java:818)

Dr-Cool commented 6 years ago

A screenshot from today's series of crashes after a reboot and when running one particular app with location on (battery saving mode, no GPS). Crashes with this app are guaranteed to happen as soon as successful localization takes place, and happen many times per minute. Closing the app and running OsmAnd+ right after it doesn't produce any crash, Déjà Vu becomes stable again.

screenshot_20180305-112305

Dr-Cool commented 6 years ago

Log contents of today's crashes:

03-05 11:23:00.788 I/dvm_lock_sample(14213): [org.fitchfamily.android.dejavu,0,Thread-2020,210,Cache.java,102,-,77,42] 03-05 11:23:00.878 I/am_crash( 2207): [14213,0,org.fitchfamily.android.dejavu,952680004,java.lang.NullPointerException,Attempt to invoke virtual method 'org.fitchfamily.android.dejavu.RfEmitter org.fitchfamily.android.dejavu.Database.getEmitter(org.fitchfamily.android.dejavu.RfIdentification)' on a null object reference,Cache.java,106] 03-05 11:23:02.519 I/sysui_histogram( 2207): [power_double_tap_interval,72489] 03-05 11:23:03.044 I/am_proc_start( 2207): [0,14554,10023,com.android.systemui:screenshot,service,com.android.systemui/.screenshot.TakeScreenshotService] 03-05 11:23:03.164 I/am_proc_bound( 2207): [0,14554,com.android.systemui:screenshot] 03-05 11:23:05.172 I/notification_enqueue( 2207): [10023,14554,com.android.systemui,2131755033,NULL,0,Notification(pri=0 contentView=null vibrate=null sound=null tick defaults=0x0 flags=0x20 color=0xff607d8b vis=PRIVATE publicVersion=Notification(pri=0 contentView=com.android.systemui/0x1090085 vibrate=null sound=null defaults=0x0 flags=0x0 color=0xff607d8b category=progress vis=PRIVATE)),0] 03-05 11:23:05.254 I/sf_frame_dur( 288): [ScreenshotAnimation,48,1,1,0,1,0,0] 03-05 11:23:05.886 I/notification_enqueue( 2207): [10023,14554,com.android.systemui,2131755033,NULL,0,Notification(pri=0 contentView=null vibrate=null sound=null tick defaults=0x0 flags=0x10 color=0xff607d8b actions=2 vis=PRIVATE publicVersion=Notification(pri=0 contentView=com.android.systemui/0x1090085 vibrate=null sound=null defaults=0x0 flags=0x10 color=0xff607d8b category=progress vis=PRIVATE)),1] 03-05 11:23:08.184 I/am_proc_died( 2207): [0,14213,org.fitchfamily.android.dejavu] 03-05 11:23:08.184 I/am_schedule_service_restart( 2207): [0,org.fitchfamily.android.dejavu/.BackendService,1000] 03-05 11:23:08.305 I/sf_frame_dur( 288): [Application Error: org.fitchfamily.android.dejavu,13,3,1,0,1,0,3] 03-05 11:23:09.211 I/am_proc_start( 2207): [0,14669,10167,org.fitchfamily.android.dejavu,service,org.fitchfamily.android.dejavu/.BackendService] 03-05 11:23:09.244 I/am_proc_bound( 2207): [0,14669,org.fitchfamily.android.dejavu] 03-05 11:23:10.523 I/am_kill ( 2207): [0,11836,be.inet.rainwidget,15,empty #17] 03-05 11:23:10.605 I/dvm_lock_sample( 2207): [system_server,1,android.ui,82,ActivityManagerService.java,3790,-,16173,16] 03-05 11:23:10.605 I/am_proc_died( 2207): [0,11836,be.inet.rainwidget] 03-05 11:23:10.608 I/am_crash( 2207): [14669,0,org.fitchfamily.android.dejavu,952680004,java.lang.NullPointerException,Attempt to invoke virtual method 'org.fitchfamily.android.dejavu.RfEmitter org.fitchfamily.android.dejavu.Cache.get(org.fitchfamily.android.dejavu.RfIdentification)' on a null object reference,BackendService.java,707]

--------- beginning of crash 03-05 00:48:33.592 E/AndroidRuntime( 5205): FATAL EXCEPTION: Thread-352 03-05 00:48:33.592 E/AndroidRuntime( 5205): Process: org.fitchfamily.android.dejavu, PID: 5205 03-05 00:48:33.592 E/AndroidRuntime( 5205): java.lang.NullPointerException: Attempt to invoke virtual method 'org.fitchfamily.android.dejavu.RfEmitter org.fitchfamily.android.dejavu.Database.getEmitter(org.fitchfamily.android.dejavu.RfIdentification)' on a null object reference 03-05 00:48:33.592 E/AndroidRuntime( 5205): at org.fitchfamily.android.dejavu.Cache.get(Cache.java:106) 03-05 00:48:33.592 E/AndroidRuntime( 5205): at org.fitchfamily.android.dejavu.BackendService.endOfPeriodProcessing(BackendService.java:945) 03-05 00:48:33.592 E/AndroidRuntime( 5205): at org.fitchfamily.android.dejavu.BackendService.backgroundProcessing(BackendService.java:727) 03-05 00:48:33.592 E/AndroidRuntime( 5205): at org.fitchfamily.android.dejavu.BackendService.access$300(BackendService.java:71) 03-05 00:48:33.592 E/AndroidRuntime( 5205): at org.fitchfamily.android.dejavu.BackendService$4.run(BackendService.java:668) 03-05 00:48:33.592 E/AndroidRuntime( 5205): at java.lang.Thread.run(Thread.java:818)

03-05 11:23:08.184 W/ActivityManager( 2207): Scheduling restart of crashed service org.fitchfamily.android.dejavu/.BackendService in 1000ms 03-05 11:23:08.290 W/AppOps ( 2207): Finishing op nesting under-run: uid 1000 pkg android code 24 time=0 duration=0 nesting=0 03-05 11:23:08.524 D/wpa_supplicant(11246): wlan0: Control interface command 'SIGNAL_POLL' 03-05 11:23:08.527 D/wpa_supplicant(11246): CTRL-DEBUG: global_ctrl_sock-sendto: sock=11 sndbuf=163840 outq=0 send_len=49 03-05 11:23:08.529 D/ConnectivityService( 2207): notifyType CAP_CHANGED for NetworkAgentInfo [WIFI () - 155] 03-05 11:23:08.531 D/ConnectivityService( 2207): updateNetworkScore for NetworkAgentInfo [WIFI () - 155] to 60 03-05 11:23:09.211 I/ActivityManager( 2207): Start proc 14669:org.fitchfamily.android.dejavu/u0a167 for service org.fitchfamily.android.dejavu/.BackendService 03-05 11:23:09.239 I/org.openbmap.unifiedNlp.geocoders.OfflineProvider(14218): Found 0 known cells 03-05 11:23:09.239 D/org.openbmap.unifiedNlp.geocoders.OfflineProvider(14218): Using 208|01|1794|10104070|LTE 03-05 11:23:09.240 D/org.openbmap.unifiedNlp.geocoders.OfflineProvider(14218): Using 208|1|1794|10104070|LTE 03-05 11:23:09.261 W/System (14669): ClassLoader referenced unknown path: /data/app/org.fitchfamily.android.dejavu-2/lib/arm 03-05 11:23:09.311 D/NlpLocBackendHelper( 4415): Bound to: ComponentInfo{org.fitchfamily.android.dejavu/org.fitchfamily.android.dejavu.BackendService} 03-05 11:23:09.313 D/DejaVu Backend(14669): onOpen() entry. 03-05 11:23:09.319 D/DejaVu GpsMonitor(14669): onCreate() 03-05 11:23:09.358 D/DejaVu GpsMonitor(14669): GpsMonitor onBind() entry. 03-05 11:23:09.360 D/DejaVu Backend(14669): mConnection.onServiceConnected()

n76 commented 6 years ago

You write "when running one particular app with location on (battery saving mode, no GPS)." Which particular app is this? I am not getting this crash with the apps I have installed and it would be helpful for me to verify any fix if I can easily duplicate the crash.

ale5000-git commented 6 years ago

@Dr-Cool: I suggest to retry with the version 1.1.3 of Déjà Vu Location Service that will appear on F-Droid in a few days.

Dr-Cool commented 6 years ago

@n76 : Tried to find out exactly which apps, and only two are creating problems among the ones left installed in my current setup: the most evident one is called Totem Mobi (https://play.google.com/store/apps/details?id=com.atrioom.totem_mobi). Unfortunately you won't be able to test the map/location function because you'd need to create a paying user account. What I can tell you is that it functions correctly with a standard Android using Google location or with a rooted phone using OpenBmapNlpBackend as location service. The second app causing crashes is Swipe for Facebook (https://play.google.com/store/apps/details?id=com.happening.studios.swipeforfacebookfree), although this one is less evident, it will crash sometimes when the location functions is activated. I believe that Firefox has also created crashes for example with the Facebook location function but this is harder to test since it's web page dependent. @ale5000-git : Yes, I'm looking ahead to running the tests again with the new version.

Dr-Cool commented 6 years ago

The log records for the Swipe crashes are very similar to the Totem Mobi crashes, below a Swipe crash log:

03-05 21:13:48.811 I/am_crash( 2207): [15104,0,org.fitchfamily.android.dejavu,952680004,java.lang.NullPointerException,Attempt to invoke virtual method 'org.fitchfamily.android.dejavu.RfEmitter org.fitchfamily.android.dejavu.Cache.get(org.fitchfamily.android.dejavu.RfIdentification)' on a null object reference,BackendService.java,707]

03-05 21:13:48.810 E/AndroidRuntime(15104): FATAL EXCEPTION: Thread-2746 03-05 21:13:48.810 E/AndroidRuntime(15104): Process: org.fitchfamily.android.dejavu, PID: 15104 03-05 21:13:48.810 E/AndroidRuntime(15104): java.lang.NullPointerException: Attempt to invoke virtual method 'org.fitchfamily.android.dejavu.RfEmitter org.fitchfamily.android.dejavu.Cache.get(org.fitchfamily.android.dejavu.RfIdentification)' on a null object reference 03-05 21:13:48.810 E/AndroidRuntime(15104): at org.fitchfamily.android.dejavu.BackendService.backgroundProcessing(BackendService.java:707) 03-05 21:13:48.810 E/AndroidRuntime(15104): at org.fitchfamily.android.dejavu.BackendService.access$300(BackendService.java:71) 03-05 21:13:48.810 E/AndroidRuntime(15104): at org.fitchfamily.android.dejavu.BackendService$4.run(BackendService.java:668)

n76 commented 6 years ago

The latest version of Déjá Vu has some changes that might, depending on timing, result in a crash at the point shown in your logcat. What version of Déjá Vu are your running.

Dr-Cool commented 6 years ago

Version 1.1.2

n76 commented 6 years ago

It is possible that v1.1.3 fixes your problem. . . Please try that and let me know the result.

Dr-Cool commented 6 years ago

OK, just tested with v1.1.3 and indeed it appears to solve the problem. No more recurrent crashes immediately after a successful location fix. Thanks again for this great backend app.