-
Notifications
You must be signed in to change notification settings - Fork 173
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.init crash on realm->_realm = Realm::get_shared_realm(config);
#5937
Comments
Potential duplicate of #5808 |
I also experience these crashes in my app.
|
I currently also get this crash to occur every time with my specific realm DB file from a client. Runtime: iOS 16.0 (20A360) - DeviceType: iPad mini (6th generation)
Seems to crash internally when I call [realm-core-11.15.0] Assertion failed: top_size > 2 && top_size <= 6 Release crash info:
MongoDB Realm Studio seems to freeze on a gray screen as well when trying to view the DB file. Debug crash info.
Re-tested on v10.32.0. Hard crash still occurs.
I can also supply the .realm file for your investigation. |
@sedwo We would very much appreciate if you could share the realm file with us. Please send to realm-help@mongodb.com |
@jedelbo sent! 👍 |
@sedwo thanks! |
Hi @jedelbo, any insights into this? |
I have spent quite amount of time trying to figure out why the a realm file could end up like the one I received. Unfortunately it did not point in a specific direction. Can I ask you if you continue to get issues from new users? |
@jedelbo unfortunately I don't have other crash reports now. From time to time similar crash report from Realm pops up from our users, but not quite the same. I'll update this ticket when I have database and report from more users. In my case, the database is shared with share extension via app group shared folder. The share extension can be used quite often and it also includes background upload which writes to database when the upload finishes. So maybe it could be some combination of access from main app, share extension and main app in background? Otherwise I can't think of anything unusual in the app. All reads are performed on main queue. All writes are performed on background queues. There can be multiple queues writing. Background writes are performed in autorelease pools. If you have any guesses what could cause this, try to write them down and maybe something will ring a bell. |
@jedelbo Is it possible for the app to somehow recover any data from this DB state? |
We now have the hypothesis that some pages are not written to the file system - probably caused by the phone somehow crashing. So, as we are lacking some data, there is no way to recover. Our design is meant to guarantee that data is written in the order expected, but it seem like that is not achieved on iOS. We expect to have a solution soon. |
Hi @jedelbo, any update to this? |
We will probably make a release later today with a possible fix. You can follow the progress here: #5993. |
Will this only prevent this particular behavior in the future or will it also fix apps with already corrupted database? |
Unfortunately we cannot automatically fix already corrupted databases. |
Hi @jedelbo when will a new Swift version will be released that contains this fix? The changelog for the new release seems not to contain it: https://github.com/realm/realm-swift/releases/tag/v10.32.3 |
Closed by #5993 |
SDK and version
SDK: Realm-Swift
Version: 10.32.0
Core: realm-core-12.9.0
Observations
User reported a startup crash in their app. I'm including their DB files in a comment below. I can reproduce the issue in the app when I replace my db files with theirs.
The crash happens when I try to perform a write soon after app launch: https://github.com/zotero/zotero-ios/blob/90c7c31c806b80ed2b1375f9f79910f4f5e20f64/Zotero/Controllers/Controllers.swift#L315-L318.
Above lines run this code: https://github.com/zotero/zotero-ios/blob/90c7c31c806b80ed2b1375f9f79910f4f5e20f64/Zotero/Controllers/Database/RealmDbStorage.swift#L57-L62.
And the
RealmDbCoordinator
pretty much just initialisesRealm
instance with given config: https://github.com/zotero/zotero-ios/blob/90c7c31c806b80ed2b1375f9f79910f4f5e20f64/Zotero/Controllers/Database/RealmDbStorage.swift#L114-L117.So to sum it up, it crashes on first initialisation of
Realm
instance which happens after app launch. Realm is not accessed anywhere else before this, no reads or writes.Crash log / stacktrace
Crash log from the user:
My stack trace from simulator:
Steps & Code to Reproduce
The text was updated successfully, but these errors were encountered: