mobile-sdk icon indicating copy to clipboard operation
mobile-sdk copied to clipboard

Increasing crashes after carto v4.4.0

Open safe-bug opened this issue 3 years ago • 13 comments

Hello

We are seeing lots of native crashes on firebase after upgrading to Carto v4.4.0 and upper versions. There is nothing in common among crash reports such as the Android version, Device model, etc and we couldn't detect a pattern to reproduce the crash. (It seems that most crashes happen in Android 11)

The stack trace is also showing nothing to follow except that the crash is coming from the Carto lib. I've posted two sample crash reports here, I hope it helps to find the issue. Can you help to find the issue?

signal 7 (SIGBUS), code 1 (BUS_ADRALN) backtrace: #00 pc 00000000002bf148 /data/app/~~8SmD0rCzP7w0vRKwEN2i3A==/==/lib/arm/libcarto_mobile_sdk.so #00 pc 00000000002bd0f7 /data/app/~~8SmD0rCzP7w0vRKwEN2i3A==//lib/arm/libcarto_mobile_sdk.so #00 pc 00000000001e8d61 /data/app/~~8SmD0rCzP7w0vRKwEN2i3A==//lib/arm/libcarto_mobile_sdk.so #00 pc 00000000001c6d6b /data/app/~~8SmD0rCzP7w0vRKwEN2i3A==//lib/arm/libcarto_mobile_sdk.so #00 pc 00000000001b631d /data/app/~~8SmD0rCzP7w0vRKwEN2i3A==//lib/arm/libcarto_mobile_sdk.so #00 pc 00000000001b12e9 /data/app/~~8SmD0rCzP7w0vRKwEN2i3A==//lib/arm/libcarto_mobile_sdk.so #00 pc 00000000001feb9b /data/app/~~8SmD0rCzP7w0vRKwEN2i3A==//lib/arm/libcarto_mobile_sdk.so #00 pc 00000000001dc8b3 /data/app/~~8SmD0rCzP7w0vRKwEN2i3A==//lib/arm/libcarto_mobile_sdk.so #00 pc 00000000000b0567 /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40) #00 pc 0000000000066b37 /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

signal 11 (SIGSEGV), code 1 (SEGV_MAPERR) #00 pc 000000000015d5b6 /data/app/~~oAX2awonvb-1bs1mV5gkBA==//lib/arm/libcarto_mobile_sdk.so #00 pc 00000000002cc4ad /data/app/~~oAX2awonvb-1bs1mV5gkBA==//lib/arm/libcarto_mobile_sdk.so #00 pc 00000000001e8a3b /data/app/~~oAX2awonvb-1bs1mV5gkBA==//lib/arm/libcarto_mobile_sdk.so #00 pc 00000000001c4743 /data/app/~~oAX2awonvb-1bs1mV5gkBA==//lib/arm/libcarto_mobile_sdk.so #00 pc 00000000001e042d /data/app/~~oAX2awonvb-1bs1mV5gkBA==//lib/arm/libcarto_mobile_sdk.so #00 pc 000000000013b173 /data/app/~~oAX2awonvb-1bs1mV5gkBA==//oat/arm/base.odex (art_jni_trampoline+130) #00 pc 0000000000340853 /data/app/~~oAX2awonvb-1bs1mV5gkBA==/oat/arm/base.odex (com.carto.ui.MapView.onDrawFrame+138) #00 pc 000000000053c765 /system/framework/arm/boot-framework.oat (android.opengl.GLSurfaceView$GLThread.guardedRun+3284) #00 pc 000000000053ce41 /system/framework/arm/boot-framework.oat (android.opengl.GLSurfaceView$GLThread.run+184) #00 pc 00000000000d3bd5 /apex/com.android.art/lib/libart.so (art_quick_invoke_stub_internal+68) #00 pc 00000000004f8681 /apex/com.android.art/lib/libart.so (art_quick_invoke_stub+280) #00 pc 000000000012c29f /apex/com.android.art/lib/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+142) #00 pc 0000000000404371 /apex/com.android.art/lib/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValuesart::ArtMethod*(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+372) #00 pc 000000000040447f /apex/com.android.art/lib/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+42) #00 pc 000000000044688f /apex/com.android.art/lib/libart.so (art::Thread::CreateCallback(void*)+1090) #00 pc 00000000000ab1fb /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40) #00 pc 0000000000063ced /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

Thanks

safe-bug avatar Jan 31 '22 08:01 safe-bug

Both log snippets refer to 'arm' architecture which means crashes on old 32-bit devices. Are all crashes related to such devices or are there some reports for 'arm64' devices? In order to proceed, we need to narrow this down as much as possible.

mtehver avatar Jan 31 '22 10:01 mtehver

@mtehver Thanks for the reply. The crashes are coming from Android SDK 29,30,31 and some of the devices are Samsung Galaxy A10s, A51, A30s, A50 Which are not old devices.

safe-bug avatar Jan 31 '22 10:01 safe-bug

@safe-bug Right, these devices are definitely arm64 devices. Can you share any crash logs on these newer devices that come from the latest SDK build (4.4.4)?

mtehver avatar Jan 31 '22 10:01 mtehver

@mtehver The only crash log data that we have is the stack traces I posted, these are the stack traces that we see in Google Play Console. Is there any other way that we could collect more crash logs for this case? (We can't reproduce the crash on our devices)

safe-bug avatar Jan 31 '22 11:01 safe-bug

@safe-bug Do you know exact SDK version used in the app for the crash logs? Also, device models could be helpful.

mtehver avatar Jan 31 '22 11:01 mtehver

@mtehver Yes, Here's the stack traces, SDK version and device models:

signal 7 (SIGBUS), code 1 (BUS_ADRALN)

Carto SDK: 4.4.3 Samsung Galaxy A01 Android 11 (SDK 30)

backtrace: #00 pc 00000000002d484c /data/app/~~gAdohKsYsR7ns_m6FQWiYA==/lib/arm/libcarto_mobile_sdk.so #00 pc 00000000002d2699 /data/app/~~gAdohKsYsR7ns_m6FQWiYA==/lib/arm/libcarto_mobile_sdk.so #00 pc 00000000001f605d /data/app/~~gAdohKsYsR7ns_m6FQWiYA==/lib/arm/libcarto_mobile_sdk.so #00 pc 00000000001d1fe1 /data/app/~~gAdohKsYsR7ns_m6FQWiYA==/lib/arm/libcarto_mobile_sdk.so #00 pc 00000000001bf8d3 /data/app/~~gAdohKsYsR7ns_m6FQWiYA==/lib/arm/libcarto_mobile_sdk.so #00 pc 00000000001baa75 /data/app/~~gAdohKsYsR7ns_m6FQWiYA==/lib/arm/libcarto_mobile_sdk.so #00 pc 0000000000210b23 /data/app/~~gAdohKsYsR7ns_m6FQWiYA==/lib/arm/libcarto_mobile_sdk.so #00 pc 00000000001e9a77 /data/app/~~gAdohKsYsR7ns_m6FQWiYA==/lib/arm/libcarto_mobile_sdk.so #00 pc 00000000000b0547 /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40) #00 pc 0000000000066b17 /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

Carto SDK: 4.4.0 Samsung Galaxy A21s Android 11 (SDK 30)

backtrace: #00 pc 000000000041179c /data/app/~~SHNfXRpu7CEYZvr5Dqi8nA==/lib/arm64/libcarto_mobile_sdk.so #00 pc 000000000040d7fc /data/app/~~SHNfXRpu7CEYZvr5Dqi8nA==/lib/arm64/libcarto_mobile_sdk.so #00 pc 00000000002f3984 /data/app/~~SHNfXRpu7CEYZvr5Dqi8nA==/lib/arm64/libcarto_mobile_sdk.so #00 pc 00000000002c98fc /data/app/~~SHNfXRpu7CEYZvr5Dqi8nA==/lib/arm64/libcarto_mobile_sdk.so #00 pc 00000000002b490c /data/app/~~SHNfXRpu7CEYZvr5Dqi8nA==/lib/arm64/libcarto_mobile_sdk.so #00 pc 00000000002ae6c0 /data/app/~~SHNfXRpu7CEYZvr5Dqi8nA==/lib/arm64/libcarto_mobile_sdk.so #00 pc 000000000030cb2c /data/app/~~SHNfXRpu7CEYZvr5Dqi8nA==/lib/arm64/libcarto_mobile_sdk.so #00 pc 00000000002e4cc0 /data/app/~~SHNfXRpu7CEYZvr5Dqi8nA==/lib/arm64/libcarto_mobile_sdk.so #00 pc 00000000000eb7a8 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) #00 pc 000000000008bc8c /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

safe-bug avatar Jan 31 '22 12:01 safe-bug

@safe-bug Thanks. Unfortunately I did not keep symbol mapping from these builds. I tried to retroactively build SDK 4.4.3 and match it with the logs, but results do not make much sense, likely there is a minor change in the build environment that causes this.

I plan to release SDK 4.4.5RC1 in a week or two and keep the symbol mapping for this build. If you are willing to upgrade to that version (and report back the latest stack traces), then we could get more useful info to investigate this further.

Also, it seems that Galaxy A01 uses 32-bit ARM target, while its CPU is 64-bit. This is quite strange and should not normally happen.

mtehver avatar Feb 01 '22 13:02 mtehver

@mtehver Sure, I will wait for the 4.4.5RC1 release and send the stack traces for you. Thank you

safe-bug avatar Feb 02 '22 06:02 safe-bug

@safe-bug I have now published 4.4.5RC1. The changes are relatively small, so it should be quite safe to use in a production app.

As I am keeping full symbol info for it, any stack traces with this version should pinpoint to the crash location.

mtehver avatar Feb 23 '22 09:02 mtehver

@mtehver Thanks, but I noticed that we've made some modifications in Carto source code for some of our use cases and your symbol map won't be the same as our build. Am I right?

safe-bug avatar Mar 05 '22 05:03 safe-bug

@safe-bug If you are using custom builds, then we are not able to map stack traces to source locations. I created a wiki page describing the steps you need to do yourself: https://github.com/CartoDB/mobile-sdk/wiki/Analyzing-native-crashes-on-Android

Once you have any crash log mapped to a source location we can take a closer look at it.

mtehver avatar Mar 07 '22 07:03 mtehver

@mtehver Sure, Thanks a lot

safe-bug avatar Mar 08 '22 11:03 safe-bug

@safe-bug Any updates on this? I am planning to release SDK 4.4.6 in a few weeks, so if there is some additional data, I could take a closer look now.

mtehver avatar May 18 '22 10:05 mtehver