Uploaded image for project: 'Realm Core'
  1. Realm Core
  2. RCORE-296

Bug in create_object_with_primary_key

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None

      Looks like a bug in the handling of hash collisions when creating an object with a primary key.

      ~~~
      /Users/realm/workspace/realm_realm-core_release_6.0.6/src/realm/table.cpp:2630: [realm-core-6.0.6] Assertion failed: new_local_id.value == local_id.get
      0 Realm 0x000000010efc18ec ZN5realm4utilL18terminate_internalERNSt3_118basic_stringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 28
      1 Realm 0x000000010efc1bdb _ZN5realm4util9terminateEPKcS2_lOSt16initializer_listINS0_9PrintableEE + 395
      2 Realm 0x000000010ef82840 ZZN5realm5Table38allocate_local_id_after_hash_collisionENS_9GlobalKeyES1_NS_6ObjKeyEENK3$_8clES1_S2 + 368
      3 Realm 0x000000010ef822a6 _ZN5realm5Table38allocate_local_id_after_hash_collisionENS_9GlobalKeyES1_NS_6ObjKeyE + 1494
      4 Realm 0x000000010ef81aad _ZN5realm5Table30create_object_with_primary_keyERKNS_5MixedE + 733
      5 Realm 0x000000010ec88baf ZN5realm6Object6createIU8strongP11objc_object18RLMAccessorContextEES0_RT0_RKNSt3_110shared_ptrINS_5RealmEEERKNS_12ObjectSchemaET_NS_12CreatePolicyENS_6ObjKeyEPNS_3ObjE + 1393
      6 Realm 0x000000010ec89484 RLMCreateObjectInRealmWithValue + 589
      7 Realm 0x000000010ecf0cf6 -[RLMRealm createObject:withValue:] + 47
      8 Realm 0x000000010ec7c8d6 -[RLMMigration createObject:withValue:] + 51
      9 RealmSwift 0x000000010f50607c $s10RealmSwift9MigrationV6create_5valueAA13DynamicObjectCSS_yptF + 76
      10 myAPP 0x000000010dcd32a1 $s14myAPP10MigrationsC17migrateFrom11To12yy10RealmSwift9MigrationVFZyAE13DynamicObjectCSg_AJtXEfU_ + 929
      11 RealmSwift 0x000000010f505f1f $s10RealmSwift9MigrationV16enumerateObjects6ofType_ySS_yAA13DynamicObjectCSg_AHtXEtFySo9RLMObjectCSg_AKtXEfU_TA + 63
      12 RealmSwift 0x000000010f505f81 $sSo9RLMObjectCSgACIggg_A2CIeggg_TRTA + 17
      13 RealmSwift 0x000000010f505fd2 $sSo9RLMObjectCSgACIeggg_A2CIyByy_TR + 66
      14 Realm 0x000000010ec7c2ef -[RLMMigration enumerateObjects:block:] + 1153
      15 RealmSwift 0x000000010f505e55 $s10RealmSwift9MigrationV16enumerateObjects6ofType_ySS_yAA13DynamicObjectCSg_AHtXEtF + 229
      16 myAPP 0x000000010dcd2ecd $s14myAPP10MigrationsC17migrateFrom11To12yy10RealmSwift9MigrationVFZ + 173
      17 myAPP 0x000000010dac6a78 $s14myAPP11DataManagerC15initializeRealm031_C941222F2AE34DCF29A683B3BFD812M0LL18realmConfigurationy0G5Swift0G0V0P0VSg_tKFyAG9MigrationV_s6UInt64VtcfU_ + 520
      18 RealmSwift 0x000000010f50648b $s10RealmSwift22accessorMigrationBlockyySo12RLMMigrationC_s6UInt64VtcyAA0D0V_AFtcFyAD_AFtcfU_ + 731
      19 RealmSwift 0x000000010f51b6a3 $sSo12RLMMigrationCs6UInt64VIeggy_AbDIeyByy_TR + 51
      20 Realm 0x000000010ec7c7e1 -[RLMMigration execute:] + 879
      21 Realm 0x000000010ecf31bf ZNSt3110function6funcIZ47+[RLMRealm realmWithConfiguration:queue:error:]E3$_2NS_9allocatorIS2_EEFvNS_10shared_ptrIN5realm5RealmEEES8_RNS6_6SchemaEEEclEOS8_SD_SA + 409
      22 Realm 0x000000010ed24529 ZNSt3110function6_funcIZN5realm5Realm13update_schemaENS2_6SchemaEyNS_8functionIFvNS_10shared_ptrIS3_EES7_RS4_EEENS5_IFvS7_EEEbE3$_1NS_9allocatorISD_EEFvvEEclEv + 227
      23 Realm 0x000000010ec3a174 ZN5realm11ObjectStore20apply_schema_changesERNS_11TransactionEyRNS_6SchemaEyNS_10SchemaModeERKNSt3_16vectorINS_12SchemaChangeENS6_9allocatorIS8_EEEENS_4util8OptionalINS6_12basic_stringIcNS6_11char_traitsIcEENS9_IcEEEEEENS6_8functionIFvvEEE + 2044
      24 Realm 0x000000010ed21ac3 ZN5realm5Realm13update_schemaENS_6SchemaEyNSt3_18functionIFvNS2_10shared_ptrIS0_EES5_RS1_EEENS3_IFvS5_EEEb + 651
      25 Realm 0x000000010ecee643 +[RLMRealm realmWithConfiguration:queue:error:] + 1644
      26 RealmSwift 0x000000010f50fea9 $s10RealmSwift0A0V5queueACSo012OS_dispatch_C0CSg_tKcfC + 105
      27 myAPP 0x000000010dac4b56 $s14myAPP11DataManagerC15initializeRealm031_C941222F2AE34DCF29A683B3BFD812M0LL18realmConfigurationy0G5Swift0G0V0P0VSg_tKF + 1094
      28 myAPP 0x000000010dac3772 $s14myAPP11DataManagerC18realmConfigurationAC10RealmSwift0H0V0G0VSg_tcfc + 226
      29 myAPP 0x000000010dac31a9 $s14myAPP11DataManagerC18realmConfigurationAC10RealmSwift0H0V0G0VSg_tcfC + 41
      30 myAPP 0x000000010dac311d globalinit_031_C941222F2AE34DCF29A683B3BFD812F0_func0 + 125
      31 libdispatch.dylib 0x000000010f63ce8e _dispatch_client_callout + 8
      32 libdispatch.dylib 0x000000010f63e3db _dispatch_once_callout + 66
      33 libswiftCore.dylib 0x00007fff5137382a swift_once + 26
      34 myAPP 0x000000010dac31f4 $s14myAPP11DataManagerC7defaultACvau + 52
      35 myAPP 0x000000010dc0225e $s14myAPP11AppDelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0l6LaunchK3KeyaypGSgtF + 510
      36 myAPP 0x000000010dc03263 $s14myAPP11AppDelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0l6LaunchK3KeyaypGSgtFTo + 211
      37 UIKitCore 0x00007fff48c82698 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 232
      38 UIKitCore 0x00007fff48c84037 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 3985
      39 UIKitCore 0x00007fff48c89bf9 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1226
      40 UIKitCore 0x00007fff4839225d -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 122
      41 UIKitCore 0x00007fff4889dcc1 _UIScenePerformActionsWithLifecycleActionMask + 83
      42 UIKitCore 0x00007fff48392d6f __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 198
      43 UIKitCore 0x00007fff4839277e -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 296
      44 UIKitCore 0x00007fff48392b9c -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 818
      45 UIKitCore 0x00007fff48392431 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 345
      46 UIKitCore 0x00007fff48396a22 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke_2 + 178
      47 UIKitCore 0x00007fff487b3dad +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:] + 852
      48 UIKitCore 0x00007fff488bc41e _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 240
      49 UIKitCore 0x00007fff4839673d __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 153
      50 UIKitCore 0x00007fff488bc321 _UISceneSettingsDiffActionPerformActionsWithDelayForTransitionContext + 84
      51 UIKitCore 0x00007fff483965ab -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 381
      52 UIKitCore 0x00007fff481eafa8 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 657
      53 UIKitCore 0x00007fff481e9b67 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 253
      54 UIKitCore 0x00007fff481eacd2 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 210
      55 UIKitCore 0x00007fff48c88141 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 512
      56 UIKitCore 0x00007fff487da8dc -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361
      57 FrontBoardServices 0x00007fff36cacd2e -[FBSSceneImpl _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 419
      58 FrontBoardServices 0x00007fff36cd2dc1 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke.154 + 102
      59 FrontBoardServices 0x00007fff36cb7757 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 220
      60 FrontBoardServices 0x00007fff36cd2a52 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke + 355
      61 libdispatch.dylib 0x000000010f63ce8e _dispatch_client_callout + 8
      62 libdispatch.dylib 0x000000010f63fda2 _dispatch_block_invoke_direct + 300
      63 FrontBoardServices 0x00007fff36cf86e9 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK

      • 30
        64 FrontBoardServices 0x00007fff36cf83d7 -[FBSSerialQueue _queue_performNextIfPossible] + 441
        65 FrontBoardServices 0x00007fff36cf88e6 -[FBSSerialQueue _performNextFromRunLoopSource] + 22
        66 CoreFoundation 0x00007fff23da0d31 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
        67 CoreFoundation 0x00007fff23da0c5c __CFRunLoopDoSource0 + 76
        68 CoreFoundation 0x00007fff23da0434 __CFRunLoopDoSources0 + 180
        69 CoreFoundation 0x00007fff23d9b02e __CFRunLoopRun + 974
        70 CoreFoundation 0x00007fff23d9a944 CFRunLoopRunSpecific + 404
        71 GraphicsServices 0x00007fff38ba6c1a GSEventRunModal + 139
        72 UIKitCore 0x00007fff48c8b9ec UIApplicationMain + 1605
        73 myAPP 0x000000010dc03f0b main + 75
        74 libdyld.dylib 0x00007fff51a231fd start + 1
        ~~~

            Assignee:
            thomas.goyne@mongodb.com Thomas Goyne
            Reporter:
            finn.schiermer-andersen@mongodb.com Finn Andersen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: