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

Thread info is not present with 3.1.0 (Android-ANR) #984

Closed
5 of 7 tasks
ItsReddi opened this issue Oct 15, 2020 · 9 comments
Closed
5 of 7 tasks

Thread info is not present with 3.1.0 (Android-ANR) #984

ItsReddi opened this issue Oct 15, 2020 · 9 comments

Comments

@ItsReddi
Copy link

Platform:

  • Android

IDE:

  • Android Studio

Build system:

  • Gradle

Sentry Android Gradle Plugin:

  • Yes
  • No

Proguard/R8:

  • Enabled
  • Disabled

The version of the SDK:
3.1.0


I have the following issue:

After upgrading from 2.3.2 to 3.1.0 ANR reports do not include any thread informations.

Steps to reproduce:

    1. use 2.3.2
    1. example ANR
if (true) {
                    int a = 0;
                    while (true) {
                        a++;
                    }
                }

Result:
grafik

    1. switch to 3.1.0
      Result:
      grafik
@marandaneto
Copy link
Contributor

thanks for raising this, would you mind to try again but enabling SentryOptions.attachThreads? thanks

@marandaneto
Copy link
Contributor

this should have done the job:


I mean it does, but it doesn't look like having the whole stack traces or it's reporting the capturing thread but not the UI one.

@ItsReddi
Copy link
Author

SentryOptions.attachThreads does not seem to make a difference.
Still no threads attached on ANR.
but im unsure it is correct how it is enabled?

grafik

@marandaneto
Copy link
Contributor

@ItsReddi this config is not available on the manifest config.

you need to: https://docs.sentry.io/platforms/android/usage/advanced-usage/#manual-instrumentation
and do options.setAttachThreads(true)

@ItsReddi
Copy link
Author

I can confirm it works with setAttachThreads(true)

@marandaneto marandaneto added Type: Bug Something isn't working and removed waiting for feedback labels Oct 16, 2020
@marandaneto
Copy link
Contributor

thanks, @ItsReddi we'll be looking into it, this flag should not have interfered in the ANR threads/stack traces if I am guessing it right.
you could use the setAttachThreads workaround for now :)

@ItsReddi
Copy link
Author

ItsReddi commented Oct 16, 2020

Allright, but it would now add the thread info to any Event, also Exceptions, custom errors if i understand the SentryOptions Docs correct?

Any way to enable that only for ANR?

@marandaneto
Copy link
Contributor

true, this was enabled by default on sentry-android v2 anyway, so it's not really a problem to send all the threads info, the thing is, most of them are not useful for you to debug the issue.

unfortunately, it's not possible to enable only for ANR, this would be the bugfix, what you can do is, to use the beforeSend callback and filter them out based on the exception type (if not ANR).

@marandaneto marandaneto changed the title Thread info is not present with 3.1.0 Thread info is not present with 3.1.0 (Android-ANR) Oct 16, 2020
@marandaneto
Copy link
Contributor

just tested it out, https://github.com/getsentry/sentry-java/releases/tag/4.0.0-alpha.2 should give you stack traces of the main thread ootb, no need for setAttachThreads unless you want to see stack traces of all the running threads.

Thanks for reporting :)

@stephanie-anderson stephanie-anderson removed the Type: Bug Something isn't working label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants