GithubHelp home page GithubHelp logo

Comments (14)

johnkiely1 avatar johnkiely1 commented on May 24, 2024 1

Thanks for the additional info @Deishelon, we agree something does look a little odd. We're now taking a look at getting this addressed.

from bugsnag-android.

azabost avatar azabost commented on May 24, 2024 1

I see, thanks. Keep us posted, please ๐Ÿ™

from bugsnag-android.

johnkiely1 avatar johnkiely1 commented on May 24, 2024

Hey @Deishelon,

It looks like you are using v5.19.2, would you be able to upgrade to the latest version v5.28.4?
We did make some changes recently which may be related. It would be good to verify if the issue you are reporting still exists on the latest version. Thanks

from bugsnag-android.

Deishelon avatar Deishelon commented on May 24, 2024

Sounds good, will get back on this

from bugsnag-android.

Deishelon avatar Deishelon commented on May 24, 2024

Hi team,

We have updated bugsnag sdk to v5.28.4, and we still seen ANRs.

Additionally, we did notice that ANR were happening in various places in bugsnag sdk, which is probably indicating that it takes longer than Android is liking to initialize the sdk as the whole, and android throws ANR while sdk is executing init code.

So, attaching a trace file of the bugsnag's Bugsnag.start function call. Which should show all the details.
2023-03-10_12-06-39_310.trace.zip

You can import this file into Android Studio to see visual,
here is the preview:
image

Thanks!

from bugsnag-android.

johnkiely1 avatar johnkiely1 commented on May 24, 2024

Hi @Deishelon, after some investigation on our side, this ANR would only occur when using BOOT_COMPLETED listeners.

One way to reliably fix this issue right now would to move the notifyNdkInForeground onto a background thread, however this is not something we can do on our side currently as would create a window where an NDK crash will report the incorrect โ€œin foregroundโ€ state (while the task to update it is still on the queue).

The best work around for you and the lesser of two evils would be for you to implement code to triggerBugsnag.starton a background thread. Hopefully that is a workable solution for you.

In the longer term, we expect this will stop being a problem as we are looking into alternative ways of foreground tracking. I don't have an eta on that as yet but we will post here with further updates.

from bugsnag-android.

Deishelon avatar Deishelon commented on May 24, 2024

Hi, we have trial'ed this over last several weeks, and we don't see this ANR anymore. Thank you for the suggestion.

Do you think there should be documentation update that recommends launching bugsnag on another thread for apps that use BOOT_COMPLETED ?

from bugsnag-android.

johnkiely1 avatar johnkiely1 commented on May 24, 2024

Hey @Deishelon, yeah adding it to the docs sounds like a good idea, we will do that as soon as we can.

from bugsnag-android.

azabost avatar azabost commented on May 24, 2024

@johnkiely1 Hey. I've just noticed the recommendation to call Bugsnag.start in a separate thread in your docs and found this issue while looking for more details. I would like to ask some questions regarding the suggested workaround.


First of all, I suppose starting BugSnag in a separate thread may result in missing some crashes because of a race condition between BugSnag's initialization and an early crash. Here's an example of such a situation:

image

Can you confirm or deny my hypothesis?


The second question is related to what you said about foreground detection:

In the longer term, we expect this will stop being a problem as we are looking into alternative ways of foreground tracking.

Since I'm working on an app that mostly contains only services and almost no UI (kind of specialized launcher), then maybe it would be better to just disable the foreground detection in BugSnag somehow to avoid this issue. Is that possible or could it be added to BugSnag's API?

from bugsnag-android.

clr182 avatar clr182 commented on May 24, 2024

Hi @azabost

You are exactly right. When initialising the notifier on a background thread there is a window where crashes may not be detected as the relevant handlers might not have been installed yet.

We donโ€™t currently have a mechanism in place to disable foreground detection. while it would be possible to add an option to disable at the moment our preference is to continue with the planned work to remove the call to ActivityManager and replace with ActivityLifecycleCallbacks to solve this issue in all cases rather than add what amounts to a workaround at the cost of some functionality.

from bugsnag-android.

clr182 avatar clr182 commented on May 24, 2024

Hi @azabost

Thank you for your patience!

Our BugSnag Android notifier v6.+ has been released, which includes a behaviour change for foreground tracking. This update should solve your issue, however if after upgrading, you are still seeing issues then please feel free to reopen this thread let us know

from bugsnag-android.

azabost avatar azabost commented on May 24, 2024

Thanks for the update ๐Ÿ™

from bugsnag-android.

szymon-miloch avatar szymon-miloch commented on May 24, 2024

Hey, @clr182 thanks for handling it.

I still see in the docs that you suggest to use separate thread for initialization, is it irrelevant now?
Source: https://docs.bugsnag.com/platforms/android/#basic-configuration

from bugsnag-android.

mclack avatar mclack commented on May 24, 2024

Hi @szymon-miloch

Yes, that documentation is now outdated. You should only need to follow that advice if you are using a version of the bugsnag-android notifier below 6.0.0.

We've added a task to update our documentation to explain this. Thank you for raising it with us.

from bugsnag-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.