Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

io.sentry.android.ndk.SentryNdk.<clinit> causes ANR #3585

Closed
seven415 opened this issue Jul 18, 2024 · 3 comments
Closed

io.sentry.android.ndk.SentryNdk.<clinit> causes ANR #3585

seven415 opened this issue Jul 18, 2024 · 3 comments
Assignees
Labels
Platform: Android Type: Bug Something isn't working
Milestone

Comments

@seven415
Copy link

Integration

sentry-android

Build System

Gradle

AGP Version

7.3.1

Proguard

Enabled

Version

7.9.0

Steps to Reproduce

sdk init

Expected Result

ANR

Actual Result

#00 pc 0x5e3e8 libc.so (syscall + 28)
#1 pc 0x131bb3 libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*) + 82)
#2 pc 0x2f5bed libart.so (art::JNI::NewWeakGlobalRef(_JNIEnv*, _jobject*) + 372)
#3 pc 0x29d11b libart.so (art::JavaVMExt::LoadNativeLibrary(_JNIEnv*, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, _jobject*, _jclass*, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >*) + 1930)
#4 pc 0x4103 libopenjdkjvm.so (JVM_NativeLoad + 246)
at java.lang.Runtime.nativeLoad(Native method)
at java.lang.Runtime.nativeLoad(Runtime.java:1131)
at java.lang.Runtime.loadLibrary0(Runtime.java:1085)
at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
at java.lang.System.loadLibrary(System.java:1664)
at io.sentry.android.ndk.SentryNdk.(SentryNdk.java:18)
at java.lang.Class.classForName(Native method)
at java.lang.Class.forName(Class.java:454)
at java.lang.Class.forName(Class.java:379)
at io.sentry.android.core.LoadClass.loadClass(LoadClass.java:21)
at io.sentry.android.core.AndroidOptionsInitializer.installDefaultIntegrations(AndroidOptionsInitializer.java:257)
at io.sentry.android.core.SentryAndroid.lambda$init$1(SentryAndroid.java:114)
at io.sentry.Sentry.applyOptionsConfiguration(Sentry.java:196)
at io.sentry.Sentry.init(Sentry.java:165)
at io.sentry.android.core.SentryAndroid.init(SentryAndroid.java:87)
at io.sentry.android.core.SentryAndroid.init(SentryAndroid.java:58)
at io.sentry.android.core.SentryInitProvider.onCreate(SentryInitProvider.java)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2429)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2399)
at io.sentry.android.core.SentryInitProvider.attachInfo(SentryInitProvider.java:39)
at android.app.ActivityThread.installProvider(ActivityThread.java:8210)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:7746)
at ccc.rrr.hhh.s.a.setEnd(Native method)
at ccc.rrr.hhh.s.a.attachBaseContext(a.java:82)
at android.app.Application.attach(Application.java:370)
at android.app.Instrumentation.newApplication(Instrumentation.java:1159)
at android.app.LoadedApk.makeApplication(LoadedApk.java:1324)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7543)
at android.app.ActivityThread.access$1500(ActivityThread.java:301)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2177)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8653)
at java.lang.reflect.Method.invoke(Native method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

@seven415 seven415 added Platform: Android Type: Bug Something isn't working labels Jul 18, 2024
@kahest kahest changed the title io.sentry.android.ndk.SentryNdk.<clinit> io.sentry.android.ndk.SentryNdk.<clinit> causes ANR Jul 19, 2024
@markushi
Copy link
Member

We could by default init the native SDK off the main thread, avoiding the slow System.loadLibrary() calls on the main thread. Maybe it's worth adding a boolean flag to force-init on the main thread (to capture startup crashes as well).

@markushi markushi added this to the 8.0.0 milestone Jul 24, 2024
@getsantry
Copy link

getsantry bot commented Aug 15, 2024

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@markushi
Copy link
Member

This has been fixed with #3670

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Android Type: Bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants