Skip to content

Symbolicating Crash Reports MapLibre Native (Android)

Bart Louwers edited this page Sep 4, 2024 · 3 revisions

Note

For information on symbolicating iOS crash reports, see this page.


You may use tools like Firebase Crashlytics to gather crash reports from the field. These crashes may not be easily reproducible and happen only for a small number of users. Since stability has a very high priority, we still appreciate receiving crash reports of this kind.

We include debug symbols with every Android release.

Screenshot 2024-05-30 at 14 02 51

You can use ndk-stack, a tool that comes with every Android NDK install, to symbolicate crash reports. For example with a tombstone from a device with the arm64-v8a architecture:

./sdk/ndk/26.1.10909125/ndk-stack -dump /Users/bart/Downloads/bugreport/FS/data/tombstones/tombstone_49 --sym debug-symbols/arm64-v8a/libmaplibre.so

You can also copy the stack trace from your logcat window (often easier if it's a crash during development) and save it in a file. Note that logcat hides stack traces in the default view (scoped to your package); you'll need to remove the filter to see the stack trace after your app crashes. Begin copying at the initial line of asterisks as noted in the Google documentation.

The symbols of the C++ Core are not included in the debug symbols part of releases. You can still get a line number where a crash occurred with llvm-addr2line. For example in the following crash:

Cause: null pointer dereference
    x0  0000000000000000  x1  0000007fd5e65d38  x2  0000000000000018  x3  0000077c511667a5
    x4  00ffffffffffffff  x5  0000000005b85818  x6  7274506576697461  x7  00000079894a9507
    x8  0000007a362cc1d0  x9  0000007a362cc040  x10 0000000000000001  x11 0000000000000000
    x12 0000007a375b9030  x13 000000007fffffff  x14 0000000005b85818  x15 0000077c5118087b
    x16 00000078dc6a30f8  x17 0000007a1cb09d58  x18 0000007a36a30000  x19 b4000078cf9c1858
    x20 b400007946945c40  x21 0000007fd5e65da0  x22 0000007fd5e65da0  x23 0000007fd5e65f88
    x24 0000000000000001  x25 b4000078cf9d4aa0  x26 b4000078c7ca1000  x27 b40000798c9f0728
    x28 b40000798c9f0750  x29 0000007fd5e65d60
    lr  00000078dc4ca40c  sp  0000007fd5e65d60  pc  00000078dc4ca40c  pst 0000000080001000
64 total frames
backtrace:
      #00 pc 000000000084d40c  /data/app/~~R-gwO6IYxQTA8dsD-VwuYg==/de.westnordost.streetcomplete-d1FWKAPDJuqyADZ00HXwTw==/lib/arm64/libmaplibre.so (BuildId: 5fd6f2e9cfe7429d5149dd7a3fde2a5f3ff1685d)
      #01 pc 000000000084a0e0  /data/app/~~R-gwO6IYxQTA8dsD-VwuYg==/de.westnordost.streetcomplete-d1FWKAPDJuqyADZ00HXwTw==/lib/arm64/libmaplibre.so (BuildId: 5fd6f2e9cfe7429d5149dd7a3fde2a5f3ff1685d)
      #02 pc 0000000000455818  /data/app/~~R-gwO6IYxQTA8dsD-VwuYg==/de.westnordost.streetcomplete-d1FWKAPDJuqyADZ00HXwTw==/lib/arm64/libmaplibre.so (mbgl::android::AndroidRendererFrontend::AndroidRendererFrontend(mbgl::android::MapRenderer&)+96) (BuildId: 5fd6f2e9cfe7429d5149dd7a3fde2a5f3ff1685d)
      #03 pc 0000000000489038  /data/app/~~R-gwO6IYxQTA8dsD-VwuYg==/de.westnordost.streetcomplete-d1FWKAPDJuqyADZ00HXwTw==/lib/arm64/libmaplibre.so (mbgl::android::NativeMapView::NativeMapView(_JNIEnv&, jni::Object<mbgl::android::NativeMapView> const&, jni::Object<mbgl::android::FileSource> const&, jni::Object<mbgl::android::MapRenderer> const&, float, unsigned char)+212) (BuildId: 5fd6f2e9cfe7429d5149dd7a3fde2a5f3ff1685d)

You would use

$ llvm-addr2line --obj debug-symbols/arm64-v8a/libmaplibre.so 000000000084a0e0
/home/runner/work/maplibre-native/maplibre-native/platform/android/src/async_task.cpp:44