-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Migration to Realm 2.0.0 - terminating with uncaught exception of type realm::SharedGroup::BadVersion: std::exception #4144
Comments
Thanks for reporting! Sorry to hear you're hitting this. We'll look into it. In the meantime, can you share an Xcode project or code sample that can trigger this? |
Can't send the Xcode project. Not here anyway ;) When I run, here is the values I see:
Run 2
Run 3
Run 4
Here is the print of Run 4 (maybe if can help)
Printing description of result:
|
+1 same exception in our project |
If you have a project that reproduces this that you're willing to share privately, please feel free to email it to help@realm.io. |
same issue |
Here are some info about the issue. The crash is only occurring on devices where big synchronisation is done. Meaning a lot of objects are created, accessed (for processing), updated,... Mostly operations added on Here is the full stack trace: https://www.dropbox.com/s/shpy6x51dp92blr/realm2.0.0Stack.png?dl=0 We tried to reproduce the crash in other projects and in a new project but since we don't know if the problem is the model, the read/write, the amount of operations,... we are a bit in the dark. Can't share the code of the project where it happens unfortunately. Note, we also have, in the same project this issue: #4143 but when a migration between 1.1.0 to 2.0.0 occurs. Don't know if it has an impact or not. |
I've run into this once, and it hasn't happened since. |
I take it back. Others are running into it. It seems to occur possibly only on a first launch post-Realm 2.0? I'll try and find some commonalities and possible reproduction steps. |
It appears that this was fixed in realm/realm-core#2218, which we incorporated in the Objective-C/Swift projects in #4156. This is a duplicate of #4143. I'd appreciate if you all could build from source using the latest If using CocoaPods, you may build form the latest pod 'Realm', git: 'https://github.com/realm/realm-cocoa.git', branch: 'master', submodules: true
pod 'RealmSwift', git: 'https://github.com/realm/realm-cocoa.git', branch: 'master', submodules: true |
We are still having this crash. Even with the latest commits on master. It seems related to the realm not being refreshed when it should. We are using a lot of background queues and operation queues with a lot of write transaction in each operation queues. The issue seems related to the fact that the autorefresh is not working when no runloop is available. We modified the core of our sync process to use a realm that is not auto-updating and calling Since we don't really now when we need to call the refresh, we are adding it a bit everywhere: before and after write transactions. Will continue to add them to test. Would love to have something done realm side instead of manually our side. Don't know why it is not done automatically, it should imho. Note: the same code did not make any issue with Realm 1.1.0 and under. But we had a lot of issues with realm files expanding beyond expected (that's why we are compating the realm at launch to avoid crashes when mmaping). Both issues are maybe related. Would love to see Realm handle write transaction in background queues safer. |
@kevincador, do you have a version of your app that reproduces this reliably? If so, would you be willing to share a precompiled IPA of that version of your app with us at help@realm.io so we can attempt to reproduce the crash ourselves? |
+1 |
How can we test the fix? |
@bdash & @tgoyne I have an app that consistently crashes with this error on startup. The crash occurs about two-thirds to three-quarters of the time. Let me know if you would like me to give help@realm.io access to the repository to help troubleshoot. |
#4180 will update the version of the object store that Realm Cocoa uses. Once that is merged you'll be able to test this fix by pointing CocoaPods at our master branch. Until then you can test by pointing it at the PR's branch ( |
@bdash I pulled the tg/update-objectstore branch, and am still experiencing the error. I deleted the app in simulator, deleted DerivedData, and tried it again, but still get the error 2/3 to 3/4 of the time. It seems to occur when the app is executing a lot of Realm writes. I'm running Xcode 8.0 with iPhone6s simulator running iOS 10. EDIT to confirm the branch I am running via Cocoapods is:
|
I did some tests on simulator (Xcode 8/iOS 10). It seems to be fixed for us. Just for documentation and if someone is wondering, here is the lines used in our pod file for our tests: pod 'Realm', :git => 'https://github.com/realm/realm-cocoa.git', :branch => 'tg/update-objectstore', submodules: true
pod 'RealmSwift', :git => 'https://github.com/realm/realm-cocoa.git', :branch => 'tg/update-objectstore', submodules: true We'll send a version to our beta testers asap to confirm it is fixed for us at a larger scale. |
I'm pleased to hear your positive results with @tgoyne's fix, @kevincador. @mlusas, can you elaborate on what you did to test? |
@bdash here are the steps I used to test:
Our app does not utilize a lot of Realm writes until the User logs in. It is after logging in, and restarting the app, that the error occurs immediately upon building. It consistently crashes about 2/3 to 3/4 of the time. Let me know if I can provide any additional information to help troubleshoot. |
Did you update your Podfile to point both Realm and RealmSwift at the branch, as @kevincador mentioned in his comment? Failing to do this will result in building RealmSwift against the most recently released version of Realm, which does not yet have the fix you're after. |
Ah, wonderful, thank you, @bdash . I ran pod update RealmSwift with the added pod 'Realm'... line, and ran the app ten times without an error. This issues seems to be fixed. For anyone following the thread, the updated Cocoapod lines are (post merge with master):
|
Hey, I still get the crash on my side, I'm using Realm 2.4.2 with iOS version 10.2 (was reproduced on simulator), here is the stuck trance in case you need it:
|
Going from RealmSwift 1.1.0 to Realm 2.0.0, with a clean install of our application, we are experiencing this crash :
libc++abi.dylib: terminating with uncaught exception of type realm::SharedGroup::BadVersion: std::exception
The code where it breaks is :
The text was updated successfully, but these errors were encountered: