realm-swift: Assertion failed: previous <= m_schema_transaction_version_max
Goals
Everytime I launch my app on a new simulator I see this crash. When I launch the simulator the second time the app runs fine. I want to identify reason for crash.
Expected Results
This crash started after updating to RealmSwift 2.5.1. What seems to be the reason for this crash?
The crash does not happen on a simulator where the app is already installed and the crash does not happen if I select ‘Reset Content and Settings’. Only on initial launch… EDIT: It does seem to crash after ‘Reset Content and Settings’ on the simulator.
Actual Results
Crashes on initial launch of a newly selected iOS simulator with the following stack trace:
/Pods/Realm/Realm/ObjectStore/src/impl/realm_coordinator.cpp:289: [realm-core-2.5.1] Assertion failed: previous <= m_schema_transaction_version_max
0 Realm 0x0000000105df6af8 _ZN5realm4utilL18terminate_internalERNSt3__118basic_stringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 40
1 Realm 0x0000000105df6df5 _ZN5realm4util9terminateEPKcS2_lOSt16initializer_listINS0_9PrintableEE + 517
2 Realm 0x0000000105abc453 _ZN5realm5_impl16RealmCoordinator20advance_schema_cacheEyy + 371
3 Realm 0x0000000105cdd98d _ZN5realm5Realm16cache_new_schemaEv + 349
4 Realm 0x0000000105cde3f3 _ZN5realm5Realm17begin_transactionEv + 787
5 Realm 0x0000000105c82d0e -[RLMRealm beginWriteTransaction] + 46
6 RealmSwift 0x00000001064c418d _TFC10RealmSwift5Realm10beginWritefT_T_ + 45
7 RealmSwift 0x00000001064c4070 _TFC10RealmSwift5Realm5writefzFzT_T_T_ + 48
8 appName 0x0000000104c19d33 _TZFe8AppNameRxC10RealmSwift6ObjectxS_17ClassAsPrimaryKeyxS_16GetNewOrExistingrS3_16getNewOrExistingfzSbT6objectx10createdNewSb_ + 1123
9 appName 0x0000000104cf9fb1 _TFC8appName11AppDelegate11applicationfTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVs10DictionaryVSC29UIApplicationLaunchOptionsKeyP____Sb + 14193
10 appName 0x0000000104cfcc44 _TToFC8appName11AppDelegate11applicationfTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVs10DictionaryVSC29UIApplicationLaunchOptionsKeyP____Sb + 180
11 UIKit 0x0000000106ee0957 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 299
12 UIKit 0x0000000106ee223c -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4119
13 UIKit 0x0000000106ee8584 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1709
14 UIKit 0x0000000106ee5793 -[UIApplication workspaceDidEndTransaction:] + 182
15 FrontBoardServices 0x000000010f4065f6 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
16 FrontBoardServices 0x000000010f40646d -[FBSSerialQueue _performNext] + 186
17 FrontBoardServices 0x000000010f4067f6 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
18 CoreFoundation 0x000000010b52ac01 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
19 CoreFoundation 0x000000010b5100cf __CFRunLoopDoSources0 + 527
20 CoreFoundation 0x000000010b50f5ff __CFRunLoopRun + 911
21 CoreFoundation 0x000000010b50f016 CFRunLoopRunSpecific + 406
22 UIKit 0x0000000106ee402f -[UIApplication _run] + 468
23 UIKit 0x0000000106eea0d4 UIApplicationMain + 159
24 appName 0x0000000104d0da97 main + 55
25 libdyld.dylib 0x000000010c86465d start + 1
26 ??? 0x0000000000000001 0x0 + 1
Steps to Reproduce
I do not know how to reproduce unfortunately.
Version of Realm and Tooling
- Realm framework version: 2.5.1
- Realm Object Server version: N/A
- Xcode version: 8.3
- iOS/OSX version: 10.3
- Dependency manager + version: CocoaPods: ?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 23 (7 by maintainers)
also seeing this in 3.21.0 and xcode 11.2. sent the debug report to help @ realm
I also see this on 3.21.0 and Xcode 11.
@bmunkholm I can start a new issue if you like, but this one was definitely my fault. I was just posting to let other’s know what to avoid.
In case it helps anyone, I also got this issue. I was running a migration in RealmJS, but also accessing items with RealmSwift at the same time to back them up to iCloud. I needed to wait until the migration completed before starting the Realm in Swift.
@DPigramIBM,
We are using:
Realm.Configuration.defaultConfiguration.fileURL?.absoluteString ?? "NONE"to define the filePath of the RealmDB.I am also seeing this issue sometimes in my project but I don’t have definitive repro steps.
Hello, i’ve had the same issues when I launch my app with the last version of Realm ObjC on a new simulator for the first time.
After some transaction, I have ‘previous’ = 5 et ‘m_schema_transaction_version_max’ = 4 when it comes to the lines:
this is the stack trace, i have :