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

Crash in DatadogExceptionHandler.uncaughtException #749

Closed
ribafish opened this issue Nov 5, 2021 · 1 comment · Fixed by #754
Closed

Crash in DatadogExceptionHandler.uncaughtException #749

ribafish opened this issue Nov 5, 2021 · 1 comment · Fixed by #754
Labels
bug Something isn't working

Comments

@ribafish
Copy link

ribafish commented Nov 5, 2021

Describe what happened
We've updated the datadog SDK from 1.8.1 to 1.10.0 and started getting reports in crashlytics about a crash in com.datadog.android.error.internal.DatadogExceptionHandler.uncaughtException (DatadogExceptionHandler.kt:48).

Stacktrace is:

Fatal Exception: java.lang.InterruptedException
       at java.lang.Thread.sleep(Thread.java)
       at java.lang.Thread.sleep(Thread.java:442)
       at java.lang.Thread.sleep(Thread.java:358)
       at com.datadog.android.core.internal.thread.ThreadPoolExecutorExtKt.waitToIdle(ThreadPoolExecutorExt.kt:22)
       at com.datadog.android.error.internal.DatadogExceptionHandler.uncaughtException(DatadogExceptionHandler.kt:48)
       at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073)
       at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
       at com.example.App.setupRxErrorHandler$lambda-1(App.kt:127)
       at com.example.App.$r8$lambda$6udbihR2S1y1Ewy0Tyb_4i9aGG8()
       at com.example.App$$ExternalSyntheticLambda0.accept(:2)
       at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:373)
       at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:50)
       at io.reactivex.Single.subscribe(Single.java:3666)
       at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
       at io.reactivex.internal.schedulers.ScheduledDirectTask.call(ScheduledDirectTask.java:38)
       at io.reactivex.internal.schedulers.ScheduledDirectTask.call(ScheduledDirectTask.java:26)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at java.lang.Thread.run(Thread.java:923)

and the com.example.App.setupRxErrorHandler$lambda-1(App.kt:127) code is:

        RxJavaPlugins.setErrorHandler { e ->
// ****** Checking for different types of exceptions and handling them accordingly, before getting to the part that's in the stacktrace above ******
            if (e is IllegalStateException) {
                // that's a bug in RxJava or in a custom operator
                Thread.currentThread().uncaughtExceptionHandler
                        .uncaughtException(Thread.currentThread(), e)   // ***** this is line 127 *****
                return@setErrorHandler
            }

Steps to reproduce the issue:
Not sure yet, still working on reproducing it.

Describe what you expected:
Not to crash because of this.

Additional context

  • Android OS version: 8 to 12
  • Device Model: at the moment, 21 different devices from different vendors (samsung, xiaomi, google, motorola, huawei, lg, onePlus,...)
  • Datadog SDK version: 1.10.0
  • Versions of any other relevant dependencies (OkHttp, …): okhttp 4.9.2, retrofit 2.9.0, rxjava2:rxandroid:2.1.1, rxjava2:rxkotlin:2.4.0, kotlin 1.5.31
  • Proguard configuration: none
  • Gradle Plugins: agp 7.0.2,
@ribafish ribafish added the bug Something isn't working label Nov 5, 2021
@xgouchet
Copy link
Member

xgouchet commented Nov 9, 2021

Hi @ribafish , thanks a lot for warning us, indeed this is a critical issue, we'll fix it really quick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants