getsentry / sentry-java

A Sentry SDK for Java, Android and other JVM languages.
https://docs.sentry.io/
MIT License
1.16k stars 435 forks source link

Crash burst on [split_config.arm64_v8a.apk!libsentry.so] sentry_options_new #3621

Closed maximkir-fl closed 1 month ago

maximkir-fl commented 2 months ago

Integration

sentry-android

Build System

Gradle

AGP Version

2.1.5

Proguard

Enabled

Version

5.7.3

Steps to Reproduce

The issue happens in production and cannot be reproduced locally. We see a lot of crashes with the same stack trace during application startup.

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 20304 >>> my_app_package <<<

backtrace:
  #00  pc 0x0000000000075954  /data/app/~~5pTkBsOHs7PX6dcejxoFbQ==/my_app_package-VXpk_yb7hBA2s1-ck3oNXA==/split_config.arm64_v8a.apk!libsentry.so (sentry_options_new) (BuildId: cf79b6320ccbf1c70b1b2f788da28fa20b3493ee)
  #01  pc 0x0000000000002418  /data/app/~~5pTkBsOHs7PX6dcejxoFbQ==/my_app_package-VXpk_yb7hBA2s1-ck3oNXA==/split_config.arm64_v8a.apk!libsentry-android.so (Java_io_sentry_android_ndk_SentryNdk_initSentryNative+344) (BuildId: 1ac206bf693002bd97cbf8697097ee8acbad0d56)
  #02  pc 0x0000000000351230  /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+144)
  #03  pc 0x00000000005b8098  /apex/com.android.art/lib64/libart.so (nterp_helper+152)
  #04  pc 0x0000000000465e4a  /data/app/~~5pTkBsOHs7PX6dcejxoFbQ==/my_app_package-VXpk_yb7hBA2s1-ck3oNXA==/base.apk (io.sentry.android.ndk.SentryNdk.init+14)
  #05  pc 0x000000000033aa80  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640)
  #06  pc 0x000000000037bf18  /apex/com.android.art/lib64/libart.so (_jobject* art::InvokeMethod<(art::PointerSize)8>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1556)
  #07  pc 0x000000000037b8f4  /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*) (.__uniq.165753521025965369065708152063621506277)+32)
  #08  pc 0x00000000003945f8  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+120)
  #09  pc 0x00000000005b8fb0  /apex/com.android.art/lib64/libart.so (nterp_helper+4016)
  #10  pc 0x000000000046200c  /data/app/~~5pTkBsOHs7PX6dcejxoFbQ==/my_app_package-VXpk_yb7hBA2s1-ck3oNXA==/base.apk (io.sentry.android.core.NdkIntegration.register+184)
  #11  pc 0x00000000005b9d74  /apex/com.android.art/lib64/libart.so (nterp_helper+7540)
  #12  pc 0x0000000000458b38  /data/app/~~5pTkBsOHs7PX6dcejxoFbQ==/my_app_package-VXpk_yb7hBA2s1-ck3oNXA==/base.apk (io.sentry.Sentry.init+196)
  #13  pc 0x000000000033aa80  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640)
  #14  pc 0x0000000000510bc0  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+2364)
  #15  pc 0x0000000000490828  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+1892)
  #16  pc 0x00000000003539d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8)
  #17  pc 0x00000000004589e8  /data/app/~~5pTkBsOHs7PX6dcejxoFbQ==/my_app_package-VXpk_yb7hBA2s1-ck3oNXA==/base.apk (io.sentry.Sentry.init)
  #18  pc 0x000000000036daec  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.18012138979834229341)+232)
  #19  pc 0x000000000036d3e4  /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+964)
  #20  pc 0x0000000000351368  /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88)
  #21  pc 0x00000000005b8098  /apex/com.android.art/lib64/libart.so (nterp_helper+152)
  #22  pc 0x0000000000462cc4  /data/app/~~5pTkBsOHs7PX6dcejxoFbQ==/my_app_package-VXpk_yb7hBA2s1-ck3oNXA==/base.apk (io.sentry.android.core.SentryAndroid.init+52)
  #23  pc 0x000000000033aa80  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640)
  #24  pc 0x0000000000510bc0  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, bool, art::JValue*)+2364)
  #25  pc 0x0000000000490828  /apex/com.android.art/lib64/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false>(art::interpreter::SwitchImplContext*)+1892)
  #26  pc 0x00000000003539d8  /apex/com.android.art/lib64/libart.so (ExecuteSwitchImplAsm+8)
  #27  pc 0x0000000000462c6c  /data/app/~~5pTkBsOHs7PX6dcejxoFbQ==/my_app_package-VXpk_yb7hBA2s1-ck3oNXA==/base.apk (io.sentry.android.core.SentryAndroid.init)
  #28  pc 0x000000000036daec  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.__uniq.112435418011751916792819755956732575238.llvm.18012138979834229341)+232)
  #29  pc 0x000000000036d3e4  /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+964)
  #30  pc 0x0000000000351368  /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88)
  #31  pc 0x00000000005b8098  /apex/com.android.art/lib64/libart.so (nterp_helper+152)
  #32  pc 0x0000000000462e70  /data/app/~~5pTkBsOHs7PX6dcejxoFbQ==/my_app_package-VXpk_yb7hBA2s1-ck3oNXA==/base.apk (io.sentry.android.core.SentryInitProvider.onCreate+56)
  #33  pc 0x00000000009ff85c  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.content.ContentProvider.attachInfo+988)
  #34  pc 0x0000000000a008e4  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.content.ContentProvider.attachInfo+52)
  #35  pc 0x00000000005b8fb0  /apex/com.android.art/lib64/libart.so (nterp_helper+4016)
  #36  pc 0x0000000000462efc  /data/app/~~5pTkBsOHs7PX6dcejxoFbQ==/my_app_package-VXpk_yb7hBA2s1-ck3oNXA==/base.apk (io.sentry.android.core.SentryInitProvider.attachInfo+28)
  #37  pc 0x0000000000876550  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.app.ActivityThread.installProvider+1712)
  #38  pc 0x0000000000875ca4  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.app.ActivityThread.installContentProviders+308)
  #39  pc 0x000000000086c2ec  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.app.ActivityThread.handleBindApplication+5596)
  #40  pc 0x0000000000860a40  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.app.ActivityThread$H.handleMessage+7728)
  #41  pc 0x0000000000b65218  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Handler.dispatchMessage+168)
  #42  pc 0x0000000000b68e28  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Looper.loopOnce+1000)
  #43  pc 0x0000000000b68998  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Looper.loop+1112)
  #44  pc 0x0000000000878f0c  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.app.ActivityThread.main+2332)
  #45  pc 0x000000000033aa80  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640)
  #46  pc 0x000000000037bf18  /apex/com.android.art/lib64/libart.so (_jobject* art::InvokeMethod<(art::PointerSize)8>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1556)
  #47  pc 0x000000000037b8f4  /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*) (.__uniq.165753521025965369065708152063621506277)+32)
  #48  pc 0x00000000003945f8  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+120)
  #49  pc 0x0000000000accb08  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+136)
  #50  pc 0x0000000000ad8210  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (com.android.internal.os.ZygoteInit.main+3584)
  #51  pc 0x000000000033aa80  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640)
  #52  pc 0x00000000004e1f4c  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+728)
  #53  pc 0x000000000057a164  /apex/com.android.art/lib64/libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+156)
  #54  pc 0x00000000000bfcd8  /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+120)
  #55  pc 0x00000000000cc448  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+872)
  #56  pc 0x0000000000002574  /system/bin/app_process64 (main+1300)
  #57  pc 0x0000000000085e10  /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+96)

Expected Result

seamless app startup.

Actual Result

crash

markushi commented 2 months ago

@maximkir-fl thanks for getting in touch with us, could you provide us some additional information about this crash?

On top of that SDK version 5.7.3 is more than two years old, have you tried upgrading to a newer version of the SDK?

maximkir-fl commented 2 months ago

Sure. The crash signal is SIGBUS.

Google Vitals summary: Image

These days, we release a newer version with the latest sentry SDK (meanwhile, no errors there).

kahest commented 2 months ago

@maximkir-fl thanks for the context - please let us know if the issue persists with the new SDK version

maximkir-fl commented 2 months ago

Hi @kahest, We inspected a similar crash for users with a newer SDK as we increased the rollout percentage.

Sentry's SDK version is:

// plugin
 id "io.sentry.android.gradle" version "4.9.0"
// sdk
sentry-android = { module = "io.sentry:sentry-android", version = "7.11.0" }

Sentry configuration:

sentry {
    autoUpload = true
    uploadNativeSymbols = false
    includeNativeSources = false
}
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 15849 >>> my.app.domain <<<

backtrace:
  #00  pc 0x00000000000669f0  /data/app/~~viwYFkLWWMdzpovALks8QQ==/my.app.domain
-UMk8blb1vKo343Xix3bqaw==/split_config.arm64_v8a.apk!libsentry.so (sentry_options_new) (BuildId: df25cf67ced5f489625cf991d0d30843cef08c1b)
  #01  pc 0x0000000000002534  /data/app/~~viwYFkLWWMdzpovALks8QQ==/my.app.domain
-UMk8blb1vKo343Xix3bqaw==/split_config.arm64_v8a.apk!libsentry-android.so (Java_io_sentry_android_ndk_SentryNdk_initSentryNative+384) (BuildId: 148db0277983ddf1bd308b29b6083fe1a81d3fef)
  #02  pc 0x0000000000351230  /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+144)
  #03  pc 0x00000000005b8098  /apex/com.android.art/lib64/libart.so (nterp_helper+152)
  #04  pc 0x0000000000624158  /data/app/~~viwYFkLWWMdzpovALks8QQ==/my.app.domain
-UMk8blb1vKo343Xix3bqaw==/base.apk (io.sentry.android.ndk.SentryNdk.init+32)
  #05  pc 0x000000000033aa80  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640)
  #06  pc 0x000000000037bf18  /apex/com.android.art/lib64/libart.so (_jobject* art::InvokeMethod<(art::PointerSize)8>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1556)
  #07  pc 0x000000000037b8f4  /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*) (.__uniq.165753521025965369065708152063621506277)+32)
  #08  pc 0x00000000003925f8  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+120)
  #09  pc 0x00000000005b8fb0  /apex/com.android.art/lib64/libart.so (nterp_helper+4016)
  #10  pc 0x000000000061ca42  /data/app/~~viwYFkLWWMdzpovALks8QQ==/my.app.domain
-UMk8blb1vKo343Xix3bqaw==/base.apk (io.sentry.android.core.NdkIntegration.e+190)
  #11  pc 0x00000000005b9e20  /apex/com.android.art/lib64/libart.so (nterp_helper+7712)
  #12  pc 0x00000000006122b8  /data/app/~~viwYFkLWWMdzpovALks8QQ==/my.app.domain
-UMk8blb1vKo343Xix3bqaw==/base.apk (io.sentry.F0.f+388)
  #13  pc 0x00000000005b8034  /apex/com.android.art/lib64/libart.so (nterp_helper+52)
  #14  pc 0x000000000061ed76  /data/app/~~viwYFkLWWMdzpovALks8QQ==/my.app.domain
-UMk8blb1vKo343Xix3bqaw==/base.apk (io.sentry.android.core.SentryInitProvider.onCreate+190)
  #15  pc 0x00000000009fbe1c  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.content.ContentProvider.attachInfo+988)
  #16  pc 0x00000000009fcea4  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.content.ContentProvider.attachInfo+52)
  #17  pc 0x00000000005b8fb0  /apex/com.android.art/lib64/libart.so (nterp_helper+4016)
  #18  pc 0x000000000061ef78  /data/app/~~viwYFkLWWMdzpovALks8QQ==/my.app.domain
-UMk8blb1vKo343Xix3bqaw==/base.apk (io.sentry.android.core.SentryInitProvider.attachInfo+28)
  #19  pc 0x00000000008734b0  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.app.ActivityThread.installProvider+1712)
  #20  pc 0x0000000000872c04  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.app.ActivityThread.installContentProviders+308)
  #21  pc 0x000000000086926c  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.app.ActivityThread.handleBindApplication+5596)
  #22  pc 0x000000000085da00  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.app.ActivityThread$H.handleMessage+7728)
  #23  pc 0x0000000000b68318  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Handler.dispatchMessage+168)
  #24  pc 0x0000000000b6bf88  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Looper.loopOnce+1000)
  #25  pc 0x0000000000b6baf8  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Looper.loop+1112)
  #26  pc 0x0000000000875e6c  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.app.ActivityThread.main+2332)
  #27  pc 0x000000000033aa80  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640)
  #28  pc 0x000000000037bf18  /apex/com.android.art/lib64/libart.so (_jobject* art::InvokeMethod<(art::PointerSize)8>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1556)
  #29  pc 0x000000000037b8f4  /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*) (.__uniq.165753521025965369065708152063621506277)+32)
  #30  pc 0x00000000003925f8  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+120)
  #31  pc 0x0000000000ac88f8  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+136)
  #32  pc 0x0000000000ad4010  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (com.android.internal.os.ZygoteInit.main+3584)
  #33  pc 0x000000000033aa80  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640)
  #34  pc 0x00000000004e1f4c  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+728)
  #35  pc 0x000000000057a164  /apex/com.android.art/lib64/libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+156)
  #36  pc 0x00000000000bfcd8  /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+120)
  #37  pc 0x00000000000cc448  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+872)
  #38  pc 0x0000000000002574  /system/bin/app_process64 (main+1300)
  #39  pc 0x0000000000085e10  /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+96)

Image

markushi commented 2 months ago

@maximkir-fl thanks for getting back to us! This definitely looks odd, one more question: Does your app use any native (C/C++) code?

If not you can disable the NDK integration, more details can be found on or docs page.

maximkir-fl commented 2 months ago

We don't use any native code directly. I will turn off the NDK integration and let you know.

markushi commented 2 months ago

@maximkir-fl did you have time to look into this?

markushi commented 1 month ago

@maximkir-fl we're closing this issue for now. If you have any feedback for us, please let us know and we'll re-open this issue.

maximkir-fl commented 1 month ago

Thanks. Once I turned off the NDK integration, the errors disappeared.