Uploaded image for project: 'Realm Cocoa SDK'
  1. Realm Cocoa SDK
  2. RCOCOA-780

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

      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<char>, std::__1::allocator<char> > 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_ptr<realm::Realm>&, realm::util::Optional<realm::VersionID>, realm::util::CheckedUniqueLock&) + 68
      8 Realm 0x102ecc0e0 realm::_impl::RealmCoordinator::get_realm(realm::Realm::Config, realm::util::Optional<realm::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 (<compiler-generated>: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 (<compiler-generated>: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

            Assignee:
            jorgen.edelbo@mongodb.com Jørgen Edelbo
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: