-
Notifications
You must be signed in to change notification settings - Fork 168
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
Realm notification listener crash #4050
Comments
There's a good chance this is the same issue as described in #4175 |
@Viktorianec can you tell if your app has been running in the background at the time the crashes happened? A possible cause might be trying to access the realm file after the device is locked and iOS revokes the access to it. Because realm files are memory-mapped we unfortunately do not get useful errors from the operating system but instead hard crashes like that. |
@fealebenpae I'm able to notice same kind of crash with almost identical stack trace. Is there anything that could be done to avoid them? Most of them happen when app is in background (based on instabugs), so most likely your assumption about iOS file rights is correct. |
@r-rebacz Could you please add the actual stack trace you are seeing and also inform about the version of Realm you are using? |
Thank you @jedelbo for your interest in the topic. We're using v10.7.4.
|
@r-rebacz I am sorry for the long delay in responding to this. I am a bit confused about the version of Realm you are using, perhaps because I am not sure if this is happening on Android or on iOS. Anyway - we have made some fixes in this area that - however - is not yet released. I hope they will also fix the issues you experience. |
@jedelbo thank you for feedback. It's iOS app. I mentioned about "iOS file rights" in one of previous comment but I should probably be more clear :) Could you please point out pull requests with fixes, so I can track when they'll get released? Thank you in advance. |
@r-rebacz The confusion comes from the fact that the stack trace does not match v10.7.4. It seems to be a newer version. You can follow realm/realm-swift#7488. |
➤ Jørgen Edelbo commented: We are waiting to see if the new release improves the situation |
We updated to 10.20.0 but we are still able to see the crash. It's an iOS app, still using the objc version of Realm. In addition to what was already said above. This crash happens for only one RLMObject (from a total of 88 Realm objects that we have), and only when it is added to Realm (not updated/deleted). The object is owner of 3 other objects (on which 2 are RLMArrays) each of them with its own children (but the entire structure is not complicated and the size of the arrays is max 15). This particular object doesn't own any RLMEmbeddedObjects, neither its children. Bottom line is that we have other objects with a structure much more complex than this one. The creation rate is also low, is usually 1 per user session. I don't see any issue with the object or its types and we're not doing anything fancy with it, but it's intriguing that it happens to only this object. It happens randomly, we weren't able to catch the crash with the debugger, only from what we see in crashlytics. This is the stack from the thread that is crashing.
Or similar ones
And this is what's always happening on the thread that is triggering the save (not sure if this is relevant in any way).
It's a bit frustrating as it happens to quite some users per day and it completely brakes their app experience. |
@tgoyne Based on your experience with notifiers, does this ring a bell? This seems to be happening when an object containing a list is created. Could it be that the list object is not properly transferred to the notification transaction? |
The crashing line here is https://github.com/realm/realm-core/blob/master/src/realm/object-store/impl/list_notifier.cpp#L100 We check if the List is valid at the start of that function ( |
Are the apps that are crashing using Realm sync? |
Oh, notification bugs related to unresolved links would be pretty unsurprising, and also would explain why it's only happening on one object (if that object is just the only one with a list with an unresolved link). This hopefully just requires fixing the index in |
It should be noted that the client cannot insert unresolved links,so this is probably not the problem here. But I agree that there are problems in handling replication of unresolved links. Created #5164. |
No. We're using Realm just for persisting data locally. |
I see the issue #5164 was merged, but didn't made it to 11.9.0. We have simplified as much as we could the object structure, we removed properties that were not important. It has now only one |
If you are not using sync, #5164 is not relevant for you. We will try to find out what we can do to find the root cause of this problem. |
I saw in Realm documents and in this thread realm/realm-swift#7164 that it's recommendable to use GCD rather than Threads for doing background work. |
@tgoyne can you comment on the above. |
There isn't any obvious reason why that would cause problems. |
I can confirm the background thread execution is not at fault. We flagged out the background task and the crash is still happening. |
One thing I saw in the latest release, there are certain situations when we have a different stack trace. In this scenario the crash happens inside a notification block, when updating the same object. Specifically, when we iterate the modifications and create a list with the changed objects (we are aware that the modifications reflect the changes in the old results and we do map it to the new results).
|
➤ Jørgen Edelbo commented: We cannot find an explanation to why you see these crashes so there is clearly something we don't know about your use case. Without a minimal reproduction case, I don't think there is a way we can proceed with this. |
Hello, this is a quite old thread. Do we have some way to reproduce this? Do we know if there was a migration that could have changed things? We some vague idea of how this could have happened, I could try to reproduce it in my environment. @bodnar-dan ... |
➤ Nicola Cabiddu commented: Closing this issue, because it is more than 1y old, and we have no clear way to reproduce it. It seems a migration could have been responsible for it, but without any further information, there is no way for us to tackle and fix the problem. |
Realm version: 10.1.1
and some previous (it was reproduce on 10.0.0 too).
It happens suddenly on 20-50 users in a day (we have around 1k users in a day). I could provide only part of stack trace from firebase:
Steps to reproduce:
unknown, sorry
The text was updated successfully, but these errors were encountered: