Giter VIP home page Giter VIP logo

Comments (7)

fractalwrench avatar fractalwrench commented on June 18, 2024

@maltzj I've created a branch to reproduce this. I've tried running the test both with the leaveBreadcrumb method present, and commented out, and both times I observe:

Test running failed: Instrumentation run failed due to 'Process crashed.'

In RxJava2 there was a change which means it's not permitted to emit null, and attempting to do so will result in a call to onError. Adding a consumer for onError would prevent an uncaught exception from crashing the instrumentation process, e.g.:

.subscribe(System.out::println, Throwable::printStackTrace);

Let me know if I've got the wrong end of the stick here and I can look into this further.

from bugsnag-android-ndk.

maltzj avatar maltzj commented on June 18, 2024

That may be true in RxJava2 land; however, we're currently living in RxJava 1 land (at least for this code). Also, this code doesn't crash in our non-test application, nor does it consistently fail, which is what I'd expect if there were an RxJava bug.

from bugsnag-android-ndk.

fractalwrench avatar fractalwrench commented on June 18, 2024

Ah right, my bad! I'll try again with RxJava1 and post results.

from bugsnag-android-ndk.

fractalwrench avatar fractalwrench commented on June 18, 2024

The following test reproduces the issue 100% of the time:

public void leaveBreadcrumb() {
        for (int k = 0; k < 100; k++) {
            Observable.fromCallable(
                    new Callable<Void>() {
                        @Override
                        public Void call() throws Exception {
                            Bugsnag.leaveBreadcrumb("some non-null value" + "some other non-null value");
                            return null;
                        }
                    })
                    .subscribeOn(Schedulers.io())
                    .subscribe();
        }
    }

Interestingly using Schedulers.immediate() passes the test, so that may be a potential workaround if you're able to inject the scheduler in for testing purposes. The Logcat seems to suggest that the NDK notifier is trying to free memory which isn't allocated - I'll have to look into this a bit further.

ndk_logcat.txt

from bugsnag-android-ndk.

maltzj avatar maltzj commented on June 18, 2024

gentle poke

from bugsnag-android-ndk.

fractalwrench avatar fractalwrench commented on June 18, 2024

@maltzj we've tracked it down to a couple of thread safety issues when adding breadcrumbs, I've linked a PR which partially fixes this if you're interesting in an explanation. Still investigating a more general fix that will prevent this altogether.

from bugsnag-android-ndk.

maltzj avatar maltzj commented on June 18, 2024

Curious if there are any plans to move forward on this, or is it going to be marked as won'tfix?

from bugsnag-android-ndk.

Related Issues (5)

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.