-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
CompositeException issue #1405
Comments
How do you recommend doing it differently? |
What about using |
We print them out when Here is the code: https://github.com/Netflix/RxJava/blob/master/rxjava-core/src/main/java/rx/exceptions/CompositeException.java Note how it will print all causes: https://github.com/Netflix/RxJava/blob/master/rxjava-core/src/main/java/rx/exceptions/CompositeException.java#L111 What version of RxJava are you running to get that stack trace? In the example you give, it looks like the chain is being cropped when it had more to display (2 causes). I'm wondering if Android does something different than normal Java and doesn't actually invoke the |
I'm using 0.19.2. I've also encountered problems with the previous version when unhandled exception in onError ended up in circular loop and crash of a StringBuilder but current implementation doesn't provide any useful information for debugging. If you are using error logging service like Bugsense or Crashlytics the only information you see is the stacktrace I've pasted above - it's useless. Solution with |
As I said above, we used to use I can't speak to Bugsense or Crashlytics, but if something printing a stack trace calls For historical information, here is the version that used We need a solution that either does not use |
Ok I've dive deeper into the implementation and it turns out that none of the
It turns out Android has its own implementation of a I don't see any solution for this issue. For KitKat and above the |
What about appending the stack trace to the message of a |
Appending the stacktrace to the message is bad practice and would be despised in non-Android environments. It's very annoying that Android does the wrong thing for this. If we do anything, it would need to special-case behavior just for Android (such as appending the whole stack trace as a message). |
I think any working solution would be appreciated by the Android developers society. I ended up wrapping the whole implementation of |
@mttkay What do you suggest be done for Android and @tomrozb According to the code I see for Android, this should work if the logger is calling How are the logs being generated? Is this default Android logging that bypasses |
Thanks for flagging this. We're still on 0.19.1 so haven't had this problem yet. I'll have a look as well. |
@benjchristensen Crash reporting tools like Crashlytics or Bugsense utilize the The I can confirm this bug on: I've not tested this on non-samsung devices but I'm sure this apply to all Android devices. |
It is very easy to understand what is going under the hood even without writing a line of code. The simplest test case:
No matter which one of the Now take a look at the Throwable implementation (Android 4.2.2)
What is important the only method used on a |
Just wondering, if the problem is that Android's This is just by reading the discussion mind you, so sorry if I'm not making any sense. I still haven't had time to bump RxJava to a newer version in our app . |
We see more threads getting stuck in infinite loops in |
So should we revert to what it was when we fixed it last time and special case Android? Or does someone have a legit fix for this? I'm planning on reverting to what was a known fix for non-Android, and then following up with a special case for Android. |
- reverting to version that just does printStackTrace - see ReactiveX#1405
Closing out again as I believe this is solved in #1632 As per comment #1632 (comment):
|
There are still issues with stack trace printing on Android with RxJava 0.20.3. For example when Simple example to reproduce:
Logcat output:
Change
Can anyone confirm this issue with the code I've attached? |
I can't help to test this as I don't do Android development or have an environment to test with. The current implementation uses If Android is completely ignoring even /cc @mttkay |
Maybe there's something wrong with my code. I've put the code above in onResume of a totally empty Activity to nail down where's the issue. If somebody can test this on other devices it would be very helpful. I don't have any non-Samsung devices at the moment. |
I'll put some time aside either tomorrow or Thursday to work through a backlog of Rx specific things. I can try to reproduce then. I haven't personally seen this issue yet (we're on 0.20.3) but I'll double check the crash logs. |
Just a quick heads up that I can confirm this issue. Not sure yet why it's happening, but swapping out the exception type does appear to fix it. Which is odd, since |
|
It's really hard to debug, unfortunately. I was able to pour your example in an automated test and run it on a Genymotion 4.3 instance -- that's the easy part. What I'm not able to do is debug into Android's stack trace methods (parts of it are native code, too, but the problem might exist on the Java layer). This might be an issue with the new project setup, I'm usually able to debug platform classes. I'll poke around some more. |
Sorry I'm still fighting the tools :-/ I might have to pick this up again another day... |
Moving Android specific discussion to ReactiveX/RxAndroid#21 |
I'm using RxJava on Android and I've encountered issues with CompositeException. Because it collects throwables as
Collection<Throwable> errors
the exceptions are not logged to the logcat output if there is an unhandled Exception in onError callback.Here is a sample output:
That's it. No logs about real cause. I can wrap my onError code in try catch block and log the real cause, but I think this can be handled better by RxJava. What do you guys think?
The text was updated successfully, but these errors were encountered: