This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Readding sources/layers to a new style #8675
Copy link
Copy link
Closed
Labels
AndroidMapbox Maps SDK for Android
Description
I'm porting iOS code to Android and hitting the following crash:
4-07 07:43:31.690 1941-1941/? A/libc: /Volumes/Android/buildbot/src/android/ndk-r13-release/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:74: void abort_message(const char *, ...): assertion "terminating with uncaught exception of type jni::PendingJavaException" failed
04-07 07:43:31.690 1941-1941/? A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 1941 (plugins.testapp)
04-07 07:43:31.690 223-223/? I/DEBUG: property debug.db.uid not set; NOT waiting for gdb.
04-07 07:43:31.690 223-223/? I/DEBUG: HINT: adb shell setprop debug.db.uid 100000
04-07 07:43:31.690 223-223/? I/DEBUG: HINT: adb forward tcp:5039 tcp:5039
04-07 07:43:31.750 223-223/? I/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-07 07:43:31.750 223-223/? I/DEBUG: Build fingerprint: 'lge/awifi_open_eu/awifi:4.2.2/JDQ39B/V50010a.1380629540:user/release-keys'
04-07 07:43:31.750 223-223/? I/DEBUG: Revision: '11'
04-07 07:43:31.750 223-223/? I/DEBUG: ABI: 'arm'
04-07 07:43:31.750 223-223/? I/DEBUG: pid: 1941, tid: 1941, name: plugins.testapp >>> com.mapbox.mapboxsdk.plugins.testapp <<<
04-07 07:43:31.750 223-223/? I/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
04-07 07:43:31.780 223-223/? I/DEBUG: Abort message: '/Volumes/Android/buildbot/src/android/ndk-r13-release/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:74: void abort_message(const char *, ...): assertion "terminating with uncaught exception of type jni::PendingJavaException" failed'
04-07 07:43:31.780 223-223/? I/DEBUG: r0 00000000 r1 00000795 r2 00000006 r3 00000000
04-07 07:43:31.780 223-223/? I/DEBUG: r4 b6f97e38 r5 00000006 r6 0000000b r7 0000010c
04-07 07:43:31.780 223-223/? I/DEBUG: r8 00000000 r9 0000000e sl bef2cb20 fp bef2cad0
04-07 07:43:31.780 223-223/? I/DEBUG: ip 00000795 sp bef2c550 lr b6e1a875 pc b6e3debc cpsr 600e0010
04-07 07:43:31.780 223-223/? I/DEBUG: backtrace:
04-07 07:43:31.780 223-223/? I/DEBUG: #00 pc 00037ebc /system/lib/libc.so (tgkill+12)
04-07 07:43:31.780 223-223/? I/DEBUG: #01 pc 00014871 /system/lib/libc.so (pthread_kill+52)
04-07 07:43:31.780 223-223/? I/DEBUG: #02 pc 000155d3 /system/lib/libc.so (raise+10)
04-07 07:43:31.780 223-223/? I/DEBUG: #03 pc 00011d25 /system/lib/libc.so (__libc_android_abort+36)
04-07 07:43:31.780 223-223/? I/DEBUG: #04 pc 000100bc /system/lib/libc.so (abort+4)
04-07 07:43:31.780 223-223/? I/DEBUG: #05 pc 00012f5d /system/lib/libc.so (__libc_fatal+16)
04-07 07:43:31.780 223-223/? I/DEBUG: #06 pc 00011da9 /system/lib/libc.so (__assert2+20)
04-07 07:43:31.780 223-223/? I/DEBUG: #07 pc 002b41f5 /data/app/com.mapbox.mapboxsdk.plugins.testapp-1/lib/arm/libmapbox-gl.so
04-07 07:43:31.780 223-223/? I/DEBUG: #08 pc 002b42d7 /data/app/com.mapbox.mapboxsdk.plugins.testapp-1/lib/arm/libmapbox-gl.so
04-07 07:43:31.780 223-223/? I/DEBUG: #09 pc 002b2aad /data/app/com.mapbox.mapboxsdk.plugins.testapp-1/lib/arm/libmapbox-gl.so
04-07 07:43:31.780 223-223/? I/DEBUG: #10 pc 002b2639 /data/app/com.mapbox.mapboxsdk.plugins.testapp-1/lib/arm/libmapbox-gl.so
04-07 07:43:31.780 223-223/? I/DEBUG: #11 pc 0003f0b3 /data/app/com.mapbox.mapboxsdk.plugins.testapp-1/lib/arm/libmapbox-gl.so
04-07 07:43:31.780 223-223/? I/DEBUG: #12 pc 00046107 /data/app/com.mapbox.mapboxsdk.plugins.testapp-1/lib/arm/libmapbox-gl.so
04-07 07:43:31.780 223-223/? I/DEBUG: #13 pc 0009141b /data/app/com.mapbox.mapboxsdk.plugins.testapp-1/lib/arm/libmapbox-gl.so
04-07 07:43:31.780 223-223/? I/DEBUG: #14 pc 0006beb7 /data/app/com.mapbox.mapboxsdk.plugins.testapp-1/lib/arm/libmapbox-gl.so
04-07 07:43:31.780 223-223/? I/DEBUG: #15 pc 0006e33d /data/app/com.mapbox.mapboxsdk.plugins.testapp-1/lib/arm/libmapbox-gl.so
04-07 07:43:31.780 223-223/? I/DEBUG: #16 pc 000d1a83 /data/app/com.mapbox.mapboxsdk.plugins.testapp-1/lib/arm/libmapbox-gl.so
04-07 07:43:31.780 223-223/? I/DEBUG: #17 pc 000139c9 /data/app/com.mapbox.mapboxsdk.plugins.testapp-1/lib/arm/libmapbox-gl.so
04-07 07:43:31.780 223-223/? I/DEBUG: #18 pc 00013275 /data/app/com.mapbox.mapboxsdk.plugins.testapp-1/lib/arm/libmapbox-gl.so
04-07 07:43:31.780 223-223/? I/DEBUG: #19 pc 00010357 /system/lib/libutils.so (android::SimpleLooperCallback::handleEvent(int, int, void*)+10)
04-07 07:43:31.780 223-223/? I/DEBUG: #20 pc 00010fb7 /system/lib/libutils.so (android::Looper::pollInner(int)+482)
04-07 07:43:31.780 223-223/? I/DEBUG: #21 pc 00011061 /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+92)
04-07 07:43:31.780 223-223/? I/DEBUG: #22 pc 0007d9d1 /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, int)+22)
04-07 07:43:31.780 223-223/? I/DEBUG: #23 pc 000b3853 /data/dalvik-cache/arm/system@framework@boot.oatThis is using a stable binary so I'm unable to do a NDK-stack at this time.
The use-case for producing this crash is the following:
- add some sources and layers to a style
- use OnMapChangeListener to check if a newer style is being loaded
- run the initialisation code of all sources and layers and add them to the new style
On iOS this is possible, on Android this results in a crash. I remember a similar issue where we had a user work around this by removing the sources and layers first before changing style. Readding them later to the new style didn't result in a crash anymore.
Though this is possible on iOS, I would like to bring this capability to Android or at least provide the user with a more actionable exception message. Being able to be more loose about reusing layers/sources will it make more easy to integrate things as plugins.
Metadata
Metadata
Assignees
Labels
AndroidMapbox Maps SDK for Android
Activity
tobrun commentedon Apr 7, 2017
Seems to be an issue from my end, after refactoring some code, the crash didn't show. Though we should look into handling:
void abort_message(const char *, ...): assertion "terminating with uncaught exception of type jni::PendingJavaException" failed'differentlyjfirebaugh commentedon Apr 7, 2017
That message happens if there's a Java -> Native JNI bridge that doesn't catch C++ exceptions before returning to Java. jni.hpp handles this automatically, but I think we're still not using it everywhere. If you can get a symbolicated stack trace, we can see if it's missing in that spot. Closing for now since we don't have a repro.