Skip to content
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

App crash everytime call to Realm to initialise the realm framework just after the app launch #6680

Closed
jain-mj opened this issue Jul 30, 2020 · 18 comments

Comments

@jain-mj
Copy link

jain-mj commented Jul 30, 2020

Crashed: com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000 realm::Table::migrate_links(realm::util::FunctionRef<void ()>)

@tgoyne the latest release of realm-cocoa 5.3.2 didn't solve the issue. Here's the stack trace obtained from firebase:

Crashed: com.apple.main-thread
0 Realm 0x10317d6bc realm::Table::migrate_links(realm::util::FunctionRef<void ()>) + 1660
1 Realm 0x1030ec11c realm::Transaction::upgrade_file_format(int) + 1716
2 Realm 0x1030f6178 realm::DB::upgrade_file_format(bool, int, int, int) + 288
3 Realm 0x1030f3f00 realm::DB::do_open(std::*1::basic_string<char, std::*1::char_traits, std::__1::allocator > const&, bool, bool, realm::DBOptions) + 3520
4 Realm 0x1030f6798 realm::DB::open(realm::Replication&, realm::DBOptions) + 244
5 Realm 0x1030faea8 realm::DB::create(realm::Replication&, realm::DBOptions) + 392
6 Realm 0x102ecd0d8 realm::_impl::RealmCoordinator::open_db() + 1156
7 Realm 0x102ecc24c realm::_impl::RealmCoordinator::do_get_realm(realm::Realm::Config, std::__1::shared_ptrrealm::Realm&, realm::util::Optionalrealm::VersionID, realm::util::CheckedUniqueLock&) + 68
8 Realm 0x102ecc0e0 realm::_impl::RealmCoordinator::get_realm(realm::Realm::Config, realm::util::Optionalrealm::VersionID) + 168
9 Realm 0x102fa2708 realm::Realm::get_shared_realm(realm::Realm::Config) + 187 (shared_realm.hpp:187)
10 Realm 0x102f71d2c ﹍[RLMRealm realmWithConfiguration:queue:error:]﹍ 4216 (memory:4216)
11 RealmSwift 0x103438640 Realm.init(configuration:queue:) + 4421240384 (:4421240384)
12 Trains 0x1010d1250 RealmManager.().init() + 24 (Database.swift:24)
13 Trains 0x1010d0e80 globalinit_33_25FF074A40C3C60802D1C0FEE730F2A4_func1972 + 17 (Database.swift:17)
14 libdispatch.dylib 0x18fb6033c _dispatch_client_callout + 20
15 libdispatch.dylib 0x18fb61a68 _dispatch_once_callout + 32
16 libswiftCore.dylib 0x19d9fc950 swift_once + 48
17 Trains 0x1010d0e58 globalinit_33_25FF074A40C3C60802D1C0FEE730F2A4_func1971 + 17 (Database.swift:17)
18 libdispatch.dylib 0x18fb6033c _dispatch_client_callout + 20
19 libdispatch.dylib 0x18fb61a68 _dispatch_once_callout + 32
20 libswiftCore.dylib 0x19d9fc950 swift_once + 48
21 Trains 0x100cd3908 LocationEventManager.loadEvents() + 14 (Database.swift:14)
22 Trains 0x100cd3754 LocationEventManager.init() + 30 (LocationEventManager.swift:30)
23 Trains 0x100cd3670 globalinit_33_E0B6503CF6537389042D9B327E6D6F29_func626 + 17 (LocationEventManager.swift:17)
24 libdispatch.dylib 0x18fb6033c _dispatch_client_callout + 20
25 libdispatch.dylib 0x18fb61a68 dispatch_once_callout + 32
26 libswiftCore.dylib 0x19d9fc950 swift_once + 48
27 Trains 0x100aad928 specialized static BackgroundUtility.runTasks(completion:) + 17 (LocationEventManager.swift:17)
28 Trains 0x100e55190 @objc AppDelegate.application(
:performFetchWithCompletionHandler:) + 4381462928 (:4381462928)
29 UIKitCore 0x19401d370 -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:] + 2276
30 UIKitCore 0x1940014ec -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 4468
31 UIKitCore 0x194007164 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1256
32 UIKitCore 0x19377703c -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 152
33 UIKitCore 0x193c42d68 _UIScenePerformActionsWithLifecycleActionMask + 112
34 UIKitCore 0x193777b70 __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 212
35 UIKitCore 0x193777654 -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 480
36 UIKitCore 0x19377798c -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 756
37 UIKitCore 0x193777214 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 340
38 UIKitCore 0x19377b930 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke_2 + 196
39 UIKitCore 0x193b61604 ﹍[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:]﹍ 856
40 UIKitCore 0x193c5ca0c _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 260
41 UIKitCore 0x19377b66c __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 156
42 UIKitCore 0x193c5c8f4 _UISceneSettingsDiffActionPerformActionsWithDelayForTransitionContext + 108
43 UIKitCore 0x19377b4c4 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 392
44 UIKitCore 0x1935e1ba4 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 640
45 UIKitCore 0x1935e06a4 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 256
46 UIKitCore 0x1935e18d4 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 236
47 UIKitCore 0x1940053fc -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 552
48 UIKitCore 0x193b87e08 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 376
49 FrontBoardServices 0x195122ffc -[FBSSceneImpl _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 440
50 FrontBoardServices 0x1951495a0 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke.168 + 116
51 FrontBoardServices 0x19512debc -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 240
52 FrontBoardServices 0x195149234 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke + 344
53 libdispatch.dylib 0x18fb6033c _dispatch_client_callout + 20
54 libdispatch.dylib 0x18fb630d4 _dispatch_block_invoke_direct + 264
55 FrontBoardServices 0x19516f6c4 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK

  • 48
    56 FrontBoardServices 0x19516f370 -[FBSSerialQueue _queue_performNextIfPossible] + 432
    57 FrontBoardServices 0x19516f8dc -[FBSSerialQueue _performNextFromRunLoopSource] + 32
    58 CoreFoundation 0x18fe3baf4 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 28
    59 CoreFoundation 0x18fe3ba48 __CFRunLoopDoSource0 + 84
    60 CoreFoundation 0x18fe3b198 __CFRunLoopDoSources0 + 196
    61 CoreFoundation 0x18fe35f38 __CFRunLoopRun + 796
    62 CoreFoundation 0x18fe358f4 CFRunLoopRunSpecific + 480
    63 GraphicsServices 0x19a24c604 GSEventRunModal + 164
    64 UIKitCore 0x194009358 UIApplicationMain + 1944
    65 Trains 0x100a173a8 main + 21 (NotificationManager.swift:21)
    66 libdyld.dylib 0x18fcb12dc start + 4

Goals

Trying to initialise the Realm on the app launch

Expected Results

App should be able to initialise the Realm and it should not crash in the Realm.init()

Actual Results

App crashed just after the launch on the Realm.init() method call.

Realm framework version: 5.3.2

Xcode version: 11.6

iOS/OSX version: iOS 13

@jain-mj jain-mj changed the title App crash everytime call to Realm Crashed: com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000 realm::Table::migrate_links(realm::util::FunctionRef<void ()>) keyboard_arrow_down App crash everytime call to Realm to initialise the realm framework just after the app launch Jul 30, 2020
@tgoyne
Copy link
Member

tgoyne commented Jul 30, 2020

Would it be possible to share a Realm file which causes this crash? I'm guessing you can't if it's happening on users' devices, but it'd make finding the exact problem very easy...

@RealmBot RealmBot changed the title App crash everytime call to Realm to initialise the realm framework just after the app launch App crash everytime call to Realm to initialise the realm framework just after the app launch Jul 30, 2020
@jain-mj
Copy link
Author

jain-mj commented Jul 31, 2020

@tgoyne I'm afraid that couldn't be done, app is crashing randomly for some users but for some users it works fine. We had to send another release with the latest version of realm(5.3.2), hoping it would solve the problem, but that too didn't work. We migrated realm framework to 5.2.0 and since then this issue started. Attaching the sample code of Realm initialisation just after the app launch.

`private let realm: Realm

init() {
do {
realm = try Realm(configuration: Realm.Configuration(fileURL: sharedRealmFileURL()))
} catch {
Logger.error(error)
}
}`

In our app we initialise the realm jus after the app launch from the
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool method.

@jain-mj
Copy link
Author

jain-mj commented Jul 31, 2020

@tgoyne Unfortunately we are not able to re-produce this at our end in the development phase ...
But its crashing on production for many users we received around 2k affected users warning on the firebase.

@qgliu
Copy link

qgliu commented Aug 4, 2020

We see the same thing in upgrading from 4.XX to 5.3.3.
As of now all users with iOS 13.5.1, iPad7,11 are affected.
It crashes in the start of the app when it try to load Realm with a let realm = try Realm().

@leemaguire
Copy link
Contributor

@qgliu Would you be able to share a stack trace & a realm file that is having issues? Thanks

@qgliu
Copy link

qgliu commented Aug 11, 2020

@leemaguire

It crashes in the beginning of the app when we start to setup the Realm configuration and start to load it. It seems crash only on specific iPads and versions. Almost 1/3 of our clients had to reinstall the app.

Known crash iOS version and iPad

iOS: 13.5.1 iPad 7,11
iOS: 13.6.0 iPad (6th generation)
iOS: 13.5.1 iPad Air 2

Code in AppDelegate

extension AppDelegate {
    /// configure realm settings: migration to new version, compact in large data
    func configRealm() {
        let config = Realm.Configuration(
            schemaVersion: 161,
            migrationBlock: { migration, oldSchemaVersion in },
            deleteRealmIfMigrationNeeded: false,
            shouldCompactOnLaunch: { totalBytes, usedBytes in
                let oneHundredMB = 100 * 1024 * 1024
                return (totalBytes > oneHundredMB) && (Double(usedBytes) / Double(totalBytes)) < 0.5
        })
        Realm.Configuration.defaultConfiguration = config
        
        // Now that we've told Realm how to handle the schema change, opening the file
        // will automatically perform the migration
        // we also delete the old orders
        do {
            let realm = try Realm()
        } catch {
            // handle error compacting or opening Realm
            print("failed to load realm with configuration")
        }
    }
}

Crash Report

Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x1b2e38d88 __pthread_kill + 8
1 libsystem_pthread.dylib 0x1b2d511e8 pthread_kill$VARIANT$mp + 136
2 libsystem_c.dylib 0x1b2ca4934 abort + 100
3 Realm 0x10408f21c realm::util::terminate(char const*, char const*, long) + 10
4 Realm 0x10408f528 realm::util::terminate_internal(std::__1::basic_stringstream<char, std::__1::char_traits, std::__1::allocator >&) + 780
5 Realm 0x10408f6a0 realm::util::terminate(char const*, char const*, long, std::initializer_listrealm::util::Printable&&) + 328
6 Realm 0x10401f680 realm::Obj::remove_backlink(realm::ColKey, realm::ObjKey, realm::CascadeState&) + 404
7 Realm 0x10401df24 realm::Obj& realm::Obj::setrealm::ObjKey(realm::ColKey, realm::ObjKey, bool) + 464
8 Realm 0x104055928 realm::Table::migrate_links(realm::util::FunctionRef<void ()>) + 1512
9 Realm 0x103fc441c realm::Transaction::upgrade_file_format(int) + 1716
10 Realm 0x103fce478 realm::DB::upgrade_file_format(bool, int, int, int) + 288
11 Realm 0x103fcc200 realm::DB::do_open(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, bool, bool, realm::DBOptions) + 3520
12 Realm 0x103fcea98 realm::DB::open(realm::Replication&, realm::DBOptions) + 244
13 Realm 0x103fd31a8 realm::DB::create(realm::Replication&, realm::DBOptions) + 392
14 Realm 0x103da53d8 realm::_impl::RealmCoordinator::open_db() + 1156
15 Realm 0x103da454c realm::impl::RealmCoordinator::do_get_realm(realm::Realm::Config, std::__1::shared_ptrrealm::Realm&, realm::util::Optionalrealm::VersionID, realm::util::CheckedUniqueLock&) + 68
16 Realm 0x103da43e0 realm::impl::RealmCoordinator::get_realm(realm::Realm::Config, realm::util::Optionalrealm::VersionID) + 168
17 Realm 0x103e7aa08 realm::Realm::get_shared_realm(realm::Realm::Config) + 187 (shared_realm.hpp:187)
18 Realm 0x103e4a02c +[RLMRealm realmWithConfiguration:queue:error:] + 4216 (memory:4216)
19 RealmSwift 0x1043105c0 Realm.init(queue:) + 4366419392 (:4366419392)
20 SelflaneShop 0x1024c478c specialized AppDelegate.configRealm() + 188 (AppDelegate.swift:188)
21 SelflaneShop 0x1024c4a18 specialized AppDelegate.application(
:didFinishLaunchingWithOptions:) + 36 (AppDelegate.swift:36)
22 SelflaneShop 0x1024c2628 @objc AppDelegate.application(
:didFinishLaunchingWithOptions:) + 4334528040 (:4334528040)
23 UIKitCore 0x1b70e0c74 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 356
24 UIKitCore 0x1b70e2a00 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 5048
25 UIKitCore 0x1b70e829c -[UIApplication _runWithMainScene:transitionContext:completion:] + 1244
26 UIKitCore 0x1b688cb70 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 148
27 UIKitCore 0x1b6d3d2dc _UIScenePerformActionsWithLifecycleActionMask + 100
28 UIKitCore 0x1b688d654 __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 196
29 UIKitCore 0x1b688d0a8 -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 288
30 UIKitCore 0x1b688d480 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 740
31 UIKitCore 0x1b688cd40 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 336
32 UIKitCore 0x1b68911dc __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke_2 + 188
33 UIKitCore 0x1b6c613a0 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:] + 812
34 UIKitCore 0x1b6d56720 _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 244
35 UIKitCore 0x1b6890f38 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 140
36 UIKitCore 0x1b6d5661c _UISceneSettingsDiffActionPerformActionsWithDelayForTransitionContext + 100
37 UIKitCore 0x1b6890da0 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 376
38 UIKitCore 0x1b6700f74 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 636
39 UIKitCore 0x1b66ffb14 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 248
40 UIKitCore 0x1b6700cac -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 220
41 UIKitCore 0x1b70e64e8 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 540
42 UIKitCore 0x1b6c8668c -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 360
43 FrontBoardServices 0x1b81ba61c -[FBSSceneImpl _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 424
44 FrontBoardServices 0x1b81df194 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke.154 + 100
45 FrontBoardServices 0x1b81c4bfc -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 232
46 FrontBoardServices 0x1b81dee50 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke + 312
47 libdispatch.dylib 0x1b2d09524 _dispatch_client_callout + 16
48 libdispatch.dylib 0x1b2cb2434 _dispatch_block_invoke_direct$VARIANT$mp + 224
49 FrontBoardServices 0x1b8203850 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 40
50 FrontBoardServices 0x1b820351c -[FBSSerialQueue _queue_performNextIfPossible] + 404
51 FrontBoardServices 0x1b8203a44 -[FBSSerialQueue _performNextFromRunLoopSource] + 28
52 CoreFoundation 0x1b2fc1c18 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 24
53 CoreFoundation 0x1b2fc1b70 __CFRunLoopDoSource0 + 80
54 CoreFoundation 0x1b2fc12f8 __CFRunLoopDoSources0 + 184
55 CoreFoundation 0x1b2fbc328 __CFRunLoopRun + 788
56 CoreFoundation 0x1b2fbbce8 CFRunLoopRunSpecific + 424
57 GraphicsServices 0x1bd10638c GSEventRunModal + 160
58 UIKitCore 0x1b70ea444 UIApplicationMain + 1932
59 SelflaneShop 0x10224a070 main + 11 (main.swift:11)
60 libdyld.dylib 0x1b2e438f0 start + 4

@leemaguire
Copy link
Contributor

@qgliu Thanks for sharing! would you be able to send us a Realm file that replicates this? Please send it to [email protected] if you can :)

@jedelbo
Copy link

jedelbo commented Aug 12, 2020

We have found at least one possible cause for this. Fix for that is under way.

@anhltsefpt
Copy link

When the new update is available ? It caused the crash to random users of my app in production. I couldn't procedure this bug on the development environment.

@jedelbo
Copy link

jedelbo commented Aug 20, 2020

v5.3.4 contains a fix that might address the issue reported here. As we have only the stacktrace it is not possible to say exactly what the problem is here, but it looks similar to the one we fixed.

@seki-ne
Copy link

seki-ne commented Aug 20, 2020

@jedelbo
sorry that we face the same issue in 5.3.3 and 5.3.4

Crashed: com.apple.main-thread
0  libsystem_kernel.dylib         0x19603b0dc __pthread_kill + 8
1  libsystem_pthread.dylib        0x1960b4094 pthread_kill$VARIANT$mp + 380
2  libsystem_c.dylib              0x195f93ea8 abort + 140
3  Realm                          0x1021cd910 realm::util::terminate(char const*, char const*, long) + 10
4  Realm                          0x1021cdc1c realm::util::terminate_internal(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) + 780
5  Realm                          0x1021cdd94 realm::util::terminate(char const*, char const*, long, std::initializer_list<realm::util::Printable>&&) + 328
6  Realm                          0x10215dd74 realm::Obj::remove_backlink(realm::ColKey, realm::ObjKey, realm::CascadeState&) + 404
7  Realm                          0x10215c618 realm::Obj& realm::Obj::set<realm::ObjKey>(realm::ColKey, realm::ObjKey, bool) + 464
8  Realm                          0x10219401c realm::Table::migrate_links(realm::util::FunctionRef<void ()>) + 1512
9  Realm                          0x1020e9640 realm::Transaction::upgrade_file_format(int) + 1716
10 Realm                          0x1020f369c realm::DB::upgrade_file_format(bool, int, int, int) + 288
11 Realm                          0x1020f1424 realm::DB::do_open(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, bool, realm::DBOptions) + 3520
12 Realm                          0x1020f3cbc realm::DB::open(realm::Replication&, realm::DBOptions) + 244
13 Realm                          0x1020f83cc realm::DB::create(realm::Replication&, realm::DBOptions) + 392
14 Realm                          0x101ed00a0 realm::_impl::RealmCoordinator::open_db() + 1156
15 Realm                          0x101ecf214 realm::_impl::RealmCoordinator::do_get_realm(realm::Realm::Config, std::__1::shared_ptr<realm::Realm>&, realm::util::Optional<realm::VersionID>, realm::util::CheckedUniqueLock&) + 68
16 Realm                          0x101ecf0a8 realm::_impl::RealmCoordinator::get_realm(realm::Realm::Config, realm::util::Optional<realm::VersionID>) + 168
17 Realm                          0x101fa5468 realm::Realm::get_shared_realm(realm::Realm::Config) + 187 (shared_realm.hpp:187)
18 Realm                          0x101f74a8c +[RLMRealm realmWithConfiguration:queue:error:] + 4216 (memory:4216)
19 RealmSwift                     0x102474610 Realm.init(queue:) + 4338370064 (<compiler-generated>:4338370064)

@jedelbo
Copy link

jedelbo commented Aug 24, 2020

@seki-ne Could it be that the problem reported here is from a situation where the realm has already been through a failing upgrade with v5.3.3 and thus already in a bad state?

@seki-ne
Copy link

seki-ne commented Aug 24, 2020

@jedelbo
i am sorry that i dont know the file is broken or not and we have not update it to v5.3.5 (core 6.0.19)
but v5.3.5 is like to not be stabilize to update
#6699 (comment)

i just want to downgrade to v4.4.1 to avoid crash with our prod app which has large number of users.
but it will crash when downgrade from v5 to v4
is there some safety way to downgrade to v4.4.1?

@jedelbo
Copy link

jedelbo commented Sep 1, 2020

@seki-ne I am sorry that the sad news is that if a file has been upgraded to v5, there is not a way to go back. The v4 client would not know how to interpret the v5 file format. However we have make a version that probably could recover a file where the upgrade was aborted in migrate_links. That fix would be available in next release.

@RealmBot
Copy link
Collaborator

RealmBot commented Sep 1, 2020

➤ Jørgen Edelbo commented:

This last comment should have been:

@seki-ne ( https://github.com/seki-ne ) I am sorry that the sad news is that if a file has been upgraded to v5, there is not a way to go back. The v4 client would not know how to interpret the v5 file format. However we have make a version that probably could recover a file where the upgrade was aborted in migrate_links. That fix would be available in next release.

@jedelbo
Copy link

jedelbo commented Sep 16, 2020

This is expected to be resolved in v5.3.6. If not please reopen.

@jedelbo jedelbo closed this as completed Sep 16, 2020
@mohsinka
Copy link

mohsinka commented Jun 3, 2021

This is occurring for us again and showing App Hang issue. Following is the stack trace:

App Hang · The app was terminated while unresponsive
0 Realm realm::ObjectStore::schema_from_group(realm::Group const&)
1 Realm realm::Realm::read_schema_from_group_if_needed()
2 Realm realm::Realm::Realm(realm::Realm::Config,realm::util::Optionalrealm::VersionID,std::__1::shared_ptrrealm::_impl::RealmCoordinator, realm::Realm::MakeSharedTag)
3 Realm std::__1::shared_ptrrealm::Realm std::__1::shared_ptrrealm::Realm::make_shared<realm::Realm::Config, realm::util::Optionalrealm::VersionID, std::__1::shared_ptrrealm::_impl::RealmCoordinator, realm::Realm::MakeSharedTag (realm::Realm::Config&&,realm::util::Optionalrealm::VersionID&&,std::__1::shared_ptrrealm::_impl::RealmCoordinator&&, realm::Realm::MakeSharedTag&&)
4 Realm realm::_impl::RealmCoordinator::do_get_realm(realm::Realm::Config, std::__1::shared_ptrrealm::Realm&, realm::util::Optionalrealm::VersionID, realm::util::CheckedUniqueLock&)
5 Realm realm::_impl::RealmCoordinator::get_realm(realm::Realm::Config, realm::util::Optionalrealm::VersionID)
6 Realm realm::Realm::get_shared_realm(realm::Realm::Config)
7 APP RLMRealm.mm:441:25 +[RLMRealm realmWithConfiguration:queue:error:]
8 RealmSwift 0x3f670
9 APP SDBRepository.swift:71:25 getInstance
10 APP getInstance
11 APP APP partial apply for closure #1

@jedelbo
Copy link

jedelbo commented Jun 3, 2021

This issue was about a crash while upgrading from one file format version to another. From the description above it looks like you are observing something different. If that is the case, I suggest you open a new issue with relevant information.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants