-
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
App crash everytime call to Realm to initialise the realm framework just after the app launch #6680
Comments
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... |
@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() { In our app we initialise the realm jus after the app launch from the |
@tgoyne Unfortunately we are not able to re-produce this at our end in the development phase ... |
We see the same thing in upgrading from 4.XX to 5.3.3. |
@qgliu Would you be able to share a stack trace & a realm file that is having issues? Thanks |
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 iPadiOS: 13.5.1 iPad 7,11 Code in AppDelegate
Crash ReportCrashed: com.apple.main-thread |
@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 :) |
We have found at least one possible cause for this. Fix for that is under way. |
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. |
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. |
@jedelbo
|
@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? |
@jedelbo i just want to downgrade to v4.4.1 to avoid crash with our prod app which has large number of users. |
@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 |
➤ 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. |
This is expected to be resolved in v5.3.6. If not please reopen. |
This is occurring for us again and showing App Hang issue. Following is the stack trace: App Hang · The app was terminated while unresponsive |
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. |
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
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
The text was updated successfully, but these errors were encountered: