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

ANR when initialising Sentry SDK #3040

Closed
Angelodaniel opened this issue Nov 8, 2023 · 3 comments · Fixed by #3043
Closed

ANR when initialising Sentry SDK #3040

Angelodaniel opened this issue Nov 8, 2023 · 3 comments · Fixed by #3043
Assignees
Labels
Platform: Android Sync: Jira apply to auto-create a Jira shadow ticket Type: Bug Something isn't working

Comments

@Angelodaniel
Copy link
Member

Angelodaniel commented Nov 8, 2023

Integration

sentry-android

Build System

Gradle

AGP Version

7.2.1

Proguard

Enabled

Version

6.28.0

Steps to Reproduce

Android config:
SentryAndroid.init(this) { options ->
options.dsn = Env.sentryDsn
options.environment = Env.sentryEnvironment
options.dist = Env.sentryEnvironment
options.tracesSampleRate = traceRate
options.sampleRate = errorRate
options.isEnableAutoActivityLifecycleTracing = false
options.isEnableActivityLifecycleBreadcrumbs = false
options.isEnableAppLifecycleBreadcrumbs = false
}

Expected Result

ANRs not to occur based on that config

Actual Result

it looks like calling system service which calls into a native methods upon creation, perhaps we could offload those integrations to a background thread

Logs:
main (runnable):tid=1 systid=10039 #00 pc 0x4a6c6c libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool) + 140) #01 pc 0x5b5674 libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const + 372) #02 pc 0x5d305c libart.so (art::DumpCheckpoint::Run(art::Thread*) + 924) #03 pc 0x5b65e0 libart.so (art::Thread::RunCheckpointFunction() + 176) #04 pc 0x674510 libart.so (art::JniMethodFastEndWithReference(_jobject*, unsigned int, art::Thread*) + 112) at java.lang.String.intern(Native method) at android.hardware.SystemSensorManager.nativeGetSensorAtIndex(Native method) at android.hardware.SystemSensorManager.<init>(SystemSensorManager.java:121) at android.app.SystemServiceRegistry$41.createService(SystemServiceRegistry.java:683) at android.app.SystemServiceRegistry$41.createService(SystemServiceRegistry.java:679) at android.app.SystemServiceRegistry$CachedServiceFetcher.getService(SystemServiceRegistry.java:1912) at android.app.SystemServiceRegistry.getSystemService(SystemServiceRegistry.java:1590) at android.app.ContextImpl.getSystemService(ContextImpl.java:1976) at android.content.ContextWrapper.getSystemService(ContextWrapper.java:813) at io.sentry.android.core.TempSensorBreadcrumbsIntegration.register(TempSensorBreadcrumbsIntegration.java:55) at io.sentry.Sentry.init(Sentry.java:237) at io.sentry.Sentry.init(Sentry.java:147) at io.sentry.android.core.SentryAndroid.init(SentryAndroid.java:89) at io.sentry.android.core.SentryAndroid.init(SentryAndroid.java:70) at com.*.BaseApplication.initializeSentry(BaseApplication.kt:137) at com.*.BaseApplication.onCreate(BaseApplication.kt:114) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7294) at android.app.ActivityThread.access$1700(ActivityThread.java:299) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2184) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:264) at android.app.ActivityThread.main(ActivityThread.java:8312) at java.lang.reflect.Method.invoke(Native method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:632) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)

┆Issue is synchronized with this Jira Improvement by Unito

@Angelodaniel Angelodaniel added Type: Bug Something isn't working Platform: Android Sync: Jira apply to auto-create a Jira shadow ticket labels Nov 8, 2023
@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 Nov 8, 2023
@romtsn romtsn moved this to Needs Discussion in Mobile & Cross Platform SDK Nov 8, 2023
@getsantry getsantry bot removed the status in GitHub Issues with 👀 Nov 8, 2023
@stefanosiano stefanosiano self-assigned this Nov 8, 2023
@stefanosiano
Copy link
Member

We can tackle this issue in this PR

@stefanosiano stefanosiano moved this from Needs Discussion to Todo in Mobile & Cross Platform SDK Nov 8, 2023
@stefanosiano
Copy link
Member

We'll put these integrations in the background, except for those needing lifecycle components access

@stefanosiano
Copy link
Member

stefanosiano commented Dec 4, 2023

this has been solved in SDK version 7.0.0 with #3036

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Android Sync: Jira apply to auto-create a Jira shadow ticket Type: Bug Something isn't working
Projects
Archived in project
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants