Closed anton-plebanovich closed 3 years ago
Hi @anton-plebanovich !
Thank you for the information above.
Could you provide a code example of what you are doing to reproduce that crash? You said it's rare but from your description it sounded like you know what it happens. It would be helpful to see some more code so that we can reproduce it on our end.
Thanks!
Kind regards, Dominic
Hi @DominicFrei , the code is complicated because there are a lot of custom classes and I don't think I can share it anyway. There is one more detail though, objects have been retained until the end of a network request but a thread is always the main. I can't reliably reproduce the crash and instead reworked code to prevent async objects usage and passing them now by thread-safe references instead.
Created this issue mostly because it says please_report_this_error_to_help_at_realm_dot_io 😄 . Maybe it'll be anyhow useful and if not I believe we can close this issue.
And thank you for doing so, @anton-plebanovich! :)
Regarding the problem with sharing code: no worries, I can understand that. Sometimes developers can excerpt some of there code which does not reveal sensitive information yet provokes a problem we talk about.
Since you mentioned ThreadSafeReference
and problems around threads.
We talked about that topic in https://github.com/realm/realm-cocoa/issues/7028 quite a lot yesterday. Can you find anything similar / helpful in there maybe?
@DominicFrei sadly the thread you mentioned is unrelated. The reporter there just has an issue with threading while I always use the main thread in my case. The other thing he has Realm 10, while I have Realm 4 which might be important. I tried to upgrade to Realm 5 but had issues with Realm notifications sporadically stop working so I had to fall back to version 4.
That's actually a good hint. Have you tried v10+ yet? Both issues might have been fixed there already. @anton-plebanovich
@DominicFrei I checked changelog and didn't see anything about both issues and there are several open issues for Realm 10 so I'm just afraid to update at this point 😱
Whats likely happening here is RxSwift is releasing the Realm objects while they are still being referenced.
@anton-plebanovich Would you be able to upgrade to the latest version of Realm? I still think this is an Rx
library related issue and not a Realm issue
@leemaguire I saw this crash only once so it might be anything actually. Let me just close this one since the Realm version is outdated and I wasn't able to reproduce.
Steps for others to Reproduce
This one is rare to reproduce, I just got a report in the Crashlytics and in the console once. Basically, objects of some type were requested, some properties were read and then it crashed during objects dealloc.
From Crashlytics:
From console:
Version of Realm and Tooling
iOS version: 14.0.1 and 13.7.0