-
Notifications
You must be signed in to change notification settings - Fork 27
RxJava2Debug causing StackOverflowError
on too complex CompositeException
#4
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
Comments
I love that test case :) Indeed, RxJava2Debug will not drop any of the causes. That's fine for the vast majority of cases, but could be an issue for overly complex scenarios. I think RxJava2Debug should support those scenarios, though. I'll give it a thought. |
Yeah, I agree with you that those scenarios should be supported, especially because we had this kind of crashes on production already ;) It seems that the most straightforward behavior would be to simply limit the included causes count to some reasonable number to avoid this kind of crashes. Anyway, I'll think about it and let you know if something will occur to me. |
Well, sorry, I don't have a better idea for now. What do you think about my previous proposal? |
So far, I see three issues:
I understand your proposal would fix the third issue. But the that is really not a RxJava2Debug issue, but an Android issue. I don't think that is this library's responsibility to solve. The other two issue I want to find a fix for. I'm still thinking about the best way to solve this 🤔 |
just an update for any observers of the issue: I'm scratching my head about how to support streams with over 95 operators in Android's VM. Can't find a way, though. I'm thinking that maybe giving the ability to disable RxJava2Debug just for a specific stream could be the way to go. Sadly, still gotta keep thinking about it. |
Would the idea be that you would opt-out of assembly tracing on a particular large workflow to avoid the StackOverFlowException? |
Yeah. I don't particularly like the idea, but that's the best I got now. |
The trouble is, I'd guess that those streams are the most likely to encounter a problem you'll want a trace for. I'm very interested in finding some kind of a solution for debugging async Rx workflows as well so I'll let you know if I come up with anything. |
True. The more complex the stream is, the higher the chances of misbehaviour.
Could you dig up one of the "real-world" failing streams and check how many operators it is composed of? |
Hi,
A solution I think would be to have in |
Hi @IDan14 , it was on hold until I got some more time. I'll give your proposal a go, because tbh my memories about this are a bit fuzzy |
Hi,
Recently I have encountered a problem using RxJava2Debug on Android.
In my project I sometimes got OOM errors when trying to log too complex
CompositeException
s from external components using AndroidLog.e
method. To avoid it I strip these exceptions to have 5 original exceptions max usingstripCompositeException
method included in the gist I linked at the end of this issue.In the regular setup this approach works correctly, but using RxJava2Debug, on less performant devices and older apis that have older memory management algorithms (in my case API 17) I got uncaught
StackOverflowError
that crashes my app. I include the error I'm encountering in the attached test case:Although, on API 25 RxJava2Debug won't crash the app and will log the exception correctly, but still, in such case the printed stacktrace is so huge that it fills up whole Android Logcat console and eventually breaks it with
read: unexpected EOF!
what also makes logging useless.Is it possible to create some constraints in RxJava2Debug that would prevent such issues?
I have created the test case here. Let me know if you wouldn't be able to reproduce the issue.
BTW - It's the exactly the same case I have reported in Traceur, which is an another attempt to do what RxJava2Debug does: T-Spoon/Traceur#4
The text was updated successfully, but these errors were encountered: