Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Random NullPointerException on Telemetry #5186

Closed
jbouzekri opened this issue May 30, 2016 · 7 comments
Closed

Random NullPointerException on Telemetry #5186

jbouzekri opened this issue May 30, 2016 · 7 comments
Assignees
Labels
Android Mapbox Maps SDK for Android crash telemetry Integration with Mapbox Telemetry libraries

Comments

@jbouzekri
Copy link

Platform: : Reproduced on

Android 5.0     71.4%
Android 5.1     14.3%
Android 6.0     14.3%

On these devices :

Galaxy S5 (klte)        42.9%
Galaxy A3 (a3ulte)      14.3%
Galaxy Note3 (hlte)     14.3%
HTC One M9 (htc_himauhl)        14.3%
Xperia M2 (D2303)       14.3%

Mapbox SDK version: : 4.0.1

Random exception on telemetry location receiver

java.lang.RuntimeException: Error receiving broadcast Intent { act=com.mapbox.mapboxsdk.telemetry.TelemetryLocationReceiver flg=0x10 (has extras) } in com.mapbox.mapboxsdk.telemetry.TelemetryLocationReceiver@2b97754
    at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:933)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:145)
    at android.app.ActivityThread.main(ActivityThread.java:5835)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: java.lang.NullPointerException: value == null
    at java.util.Hashtable.put(Hashtable.java:362)
    at com.mapbox.mapboxsdk.telemetry.MapboxEventManager.addLocationEvent(MapboxEventManager.java:258)
    at com.mapbox.mapboxsdk.telemetry.TelemetryLocationReceiver.onReceive(TelemetryLocationReceiver.java:67)
    at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:923)
    ... 8 more

This exception does not seem to happen in our code base. So I think it is a bug in the core.

@tobrun tobrun added Android Mapbox Maps SDK for Android telemetry Integration with Mapbox Telemetry libraries crash labels May 30, 2016
@bleege
Copy link
Contributor

bleege commented Jun 5, 2016

@jbouzekri Thanks for reporting this issue and what devices you've experienced troubles with. We'll be sure to look into this. In the meantime, could you help us understand what the percentages mean in your API and Devices tables?

@bleege
Copy link
Contributor

bleege commented Jun 5, 2016

Looking at the source code where the stack trace says that the error occurred it appears that the mapboxSessionId hasn't been configured yet and because it's trying to be stored in a Hashtable that's causing it to break. It looks like a couple of things could be contributing to this. First, it looks like rotateSessionId() is being called after TelemetryService is starting up which means that this value likely won't have been set yet. Secondly, rotateSessionId()'s if statement looks like it could be precluding the mapboxSessionId from ever being initialized due to a time. I'm going to switch both of these and see how that plays.

// Error Causing Code
event.put(MapboxEvent.ATTRIBUTE_SESSION_ID, encodeString(mapboxSessionId));

bleege added a commit that referenced this issue Jun 5, 2016
…d ensuring that mapboxSessionId is initialized
@bleege bleege self-assigned this Jun 5, 2016
@bleege
Copy link
Contributor

bleege commented Jun 5, 2016

Next steps are for me to test this out more thoroughly on devices to make sure no regressions have crept in and then discuss adding this to the android-4.1.0 milestone with @tobrun @zugaldia @cammace .

@jbouzekri
Copy link
Author

@bleege Thank you for taking this issue up ;). The percentages are a copy/paste of the dashboard google play where crashes appear when they are reported by customers.

So we have for example 71% of this type of crashes occurred on Android 5.0 and 42.9% occurred on a Galaxy S5.

@bleege
Copy link
Contributor

bleege commented Jun 6, 2016

Discussed with @tobrun @zugaldia this morning and we're going to include this in Android 4.1.0.

@jbouzekri
Copy link
Author

Awesome. Do you have an ETA to provide ?

bleege added a commit that referenced this issue Jun 6, 2016
…d ensuring that mapboxSessionId is initialized
bleege added a commit that referenced this issue Jun 6, 2016
…d ensuring that mapboxSessionId is initialized
@bleege
Copy link
Contributor

bleege commented Jun 6, 2016

I just cherry picked this into release-android-4.1.0 from master so this will be in the next beta release (likely happening in the next day or so) as well as the next SNAPSHOT which I've just started the build process (should be available within the hour).

@bleege bleege closed this as completed Jun 6, 2016
@bleege bleege mentioned this issue Jun 8, 2016
14 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android crash telemetry Integration with Mapbox Telemetry libraries
Projects
None yet
Development

No branches or pull requests

3 participants