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

Random NullPointerException on Telemetry #5186

Closed

Description

@jbouzekri

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.

Activity

  1. added
    Android
    telemetry
    on May 30, 2016
  2. bleege commented on Jun 5, 2016

    @bleege
    Contributor

    @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?

  3. bleege commented on Jun 5, 2016

    @bleege
    Contributor

    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));
  4. added a commit that references this issue on Jun 5, 2016
  5. self-assigned this
    on Jun 5, 2016
  6. bleege commented on Jun 5, 2016

    @bleege
    Contributor

    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 .

  7. jbouzekri commented on Jun 5, 2016

    @jbouzekri
    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.

  8. bleege commented on Jun 6, 2016

    @bleege
    Contributor

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

  9. added this to the android-v4.1.0 milestone on Jun 6, 2016
  10. jbouzekri commented on Jun 6, 2016

    @jbouzekri
    Author

    Awesome. Do you have an ETA to provide ?

  11. added 2 commits that reference this issue on Jun 6, 2016
  12. bleege commented on Jun 6, 2016

    @bleege
    Contributor

    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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Androidcrashtelemetry

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions