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

Crasher in encrypted_file_mapping.hpp:147

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: None
    • Component/s: None

      Goals

      Upgraded from 3.17 to 5.1.0. Our app syncs with data from a cloud based hardware device to get current states and update a local realm with the values fetched from http requests and web sockets. This happens on background threads within the up to free up the UI to show sync status.

      Expected Results

      Sync completes and app becomes usable

      Actual Results

      App crashes with the following stack trace.

      > /Users/realm/workspace/realm_realm-core_release_6.0.6@2/src/realm/util/encrypted_file_mapping.hpp:147: [realm-core-6.0.6] Assertion failed: addr >= m_addr with (addr, m_addr) = [true, true]
      > 0 Realm 0x000000010520c3e1 ZN5realm4utilL18terminate_internalERNSt3_118basic_stringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 28
      > 1 Realm 0x000000010520c68a _ZN5realm4util19terminate_with_infoEPKcS2_lS2_OSt16initializer_listINS0_9PrintableEE + 193
      > 2 Realm 0x00000001051fb954 ZNSt31L20_throw_length_errorEPKc + 0
      > 3 Realm 0x00000001051fb6c8 _ZNK5realm4util20EncryptedFileMapping26get_local_index_of_addressEPKvm + 108
      > 4 Realm 0x00000001051fb714 _ZN5realm4util20EncryptedFileMapping12read_barrierEPKvmPFmPKcE + 34
      > 5 Realm 0x0000000104b3c0b1 _ZN5realm4util26do_encryption_read_barrierEPKvmPFmPKcEPNS0_20EncryptedFileMappingE + 81
      > 6 Realm 0x0000000104b3bf40 _ZN5realm4util23encryption_read_barrierEPKvmPNS0_20EncryptedFileMappingEPFmPKcE + 96
      > 7 Realm 0x0000000104b3bdae _ZNK5realm9Allocator9translateEm + 222
      > 8 Realm 0x0000000105196caf ZNK5realm10IndexArray16index_string_allENS_10StringDataERNSt3_16vectorINS_6ObjKeyENS2_9allocatorIS4_EEEERKNS_13ClusterColumnE + 325
      > 9 Realm 0x0000000104d9e8a5 ZNK5realm11StringIndex8find_allIxEEvRNSt3_16vectorINS_6ObjKeyENS2_9allocatorIS4_EEEET_b + 181
      > 10 Realm 0x00000001050926da _ZN5realm11IntegerNodeINS_12ArrayIntegerENS_5EqualEE4initEv + 104
      > 11 Realm 0x000000010505fef6 _ZNK5realm5Query4initEv + 46
      > 12 Realm 0x000000010505ff8e _ZNK5realm5Query8find_allERNS_14ConstTableViewEmmm + 90
      > 13 Realm 0x00000001051efe82 _ZN5realm14ConstTableView7do_syncEv + 562
      > 14 Realm 0x00000001050602e7 _ZN5realm5Query8find_allEmmm + 81
      > 15 Realm 0x000000010506063d _ZN5realm5Query8find_allERKNS_18DescriptorOrderingE + 243
      > 16 Realm 0x0000000104c77702 _ZN5realm7Results27do_evaluate_query_if_neededEb + 658
      > 17 Realm 0x0000000104c76d95 _ZN5realm7Results7try_getINS_3ObjEEENS_4util8OptionalIT_EEm + 741
      > 18 Realm 0x0000000104c7729c _ZN5realm7Results5firstINS_3ObjEEENS_4util8OptionalIT_EEv + 92
      > 19 Realm 0x0000000104ea52e5 ZZN5realm7Results5firstI18RLMAccessorContextEEDaRT_ENKUlTyS4_E_clIPNS_3ObjEEES3_S4

      • 69
        > 20 Realm 0x0000000104ea41c5 ZN5realmL14switch_on_typeINS_3ObjEZNS_7Results5firstI18RLMAccessorContextEEDaRT_EUlTyS6_E_EES5_NS_12PropertyTypeEOT0 + 1429
        > 21 Realm 0x0000000104ea3c27 ZNK5realm7Results8dispatchIZNS0_5firstI18RLMAccessorContextEEDaRT_EUlTyS5_E_EES4_OS5 + 71
        > 22 Realm 0x0000000104ea3bd1 ZN5realm7Results5firstI18RLMAccessorContextEEDaRT + 65
        > 23 Realm 0x0000000104ea3b7e _ZZ25-[RLMResults firstObject]ENK3$_8clEv + 62
        > 24 Realm 0x0000000104e9e697 _ZL25translateRLMResultsErrorsIZ25-[RLMResults firstObject]E3$_8EDaOT_P8NSString + 55
        > 25 Realm 0x0000000104e9e5f7 -[RLMResults firstObject] + 151
        > 26 RealmSwift 0x0000000106f4e364 $s10RealmSwift7ResultsV5firstxSgvg + 132
        > 27 Control4 0x0000000100c5ec25 $s8Control411DataServiceC13getRoomWithID04roomG002C4B3Kit0E0CSgSiSg_tF + 1381
        > 28 Control4 0x0000000100c69e99 $s8Control411DataServiceCAA08LocationC8ProtocolA2aDP13getRoomWithID04roomI002C4B3Kit0G0CSgSiSg_tFTW + 25
        > 29 Control4 0x0000000100e90527 $s8Control420ExperienceHeaderViewC06updateC07forTypeyAA0bcG0O_tF + 13575
        > 30 Control4 0x0000000100ea56e1 $s8Control420ExperienceHeaderViewCAA0bC8ProtocolA2aDP06updateC07forTypeyAA0bcH0O_tFTW + 17
        > 31 Control4 0x000000010076ab6e $s8Control418RoomViewControllerC12updateHeaderyyF + 1518
        > 32 Control4 0x00000001007566c0 $s8Control418RoomViewControllerC14viewWillAppearyySbFyycfU_ + 64
        > 33 C4AppKit 0x0000000107611ca4 $s8C4AppKit18AsyncBlockProtocolPAAE05asyncE0yyyycF + 308
        > 34 Control4 0x0000000100756658 $s8Control418RoomViewControllerC14viewWillAppearyySbF + 408
        > 35 Control4 0x0000000100756758 $s8Control418RoomViewControllerC14viewWillAppearyySbFTo + 56
        > 36 UIKitCore 0x00007fff485e6892 -[UIViewController _setViewAppearState:isAnimating:] + 634
        > 37 UIKitCore 0x00007fff485e6f75 -[UIViewController __viewWillAppear:] + 115
        > 38 UIKitCore 0x00007fff4855ee9f -[UIPageViewController _child:beginAppearanceTransition:animated:] + 99
        > 39 UIKitCore 0x00007fff4855ef99 -[UIPageViewController _child:beginAppearanceTransitionIfPossible:animated:] + 85
        > 40 UIKitCore 0x00007fff48567bf6 -[UIPageViewController queuingScrollView:willManuallyScroll:toRevealView:concealView:animated:] + 479
        > 41 UIKitCore 0x00007fff485739d6 -[_UIQueuingScrollView _notifyDelegateWillManuallyScroll:toRevealView:concealingView:animated:] + 127
        > 42 UIKitCore 0x00007fff48573da3 -[_UIQueuingScrollView setView:direction:animated:completion:] + 358
        > 43 UIKitCore 0x00007fff485651fe -[UIPageViewController _setViewControllers:withScrollInDirection:animated:completion:] + 643
        > 44 UIKitCore 0x00007fff485653a9 -[UIPageViewController setViewControllers:direction:animated:completion:] + 263
        > 45 Control4 0x0000000100faaf8b $s8Control428HomeScreenPageViewControllerC18refreshCurrentRoom4room5pageryAA0iE5ModelVSg_Si5pages_Si12currentIndexttFyycfU_ + 1435
        > 46 Control4 0x00000001005c3340 $sIeg_IeyB_TR + 48
        > 47 libdispatch.dylib 0x000000010c53cf11 _dispatch_call_block_and_release + 12
        > 48 libdispatch.dylib 0x000000010c53de8e _dispatch_client_callout + 8
        > 49 libdispatch.dylib 0x000000010c54bd97 _dispatch_main_queue_callback_4CF + 1149
        > 50 CoreFoundation 0x00007fff23da0909 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9
        > 51 CoreFoundation 0x00007fff23d9b459 __CFRunLoopRun + 2041
        > 52 CoreFoundation 0x00007fff23d9a944 CFRunLoopRunSpecific + 404
        > 53 GraphicsServices 0x00007fff38ba6c1a GSEventRunModal + 139
        > 54 UIKitCore 0x00007fff48c8b9ec UIApplicationMain + 1605
        > 55 Control4 0x0000000100c49a8b main + 75
        > 56 libdyld.dylib 0x00007fff51a231fd start + 1!!! IMPORTANT: Please send this log and info about Realm SDK version and other relevant reproduction info to help@realm.io.2020-06-24 11:58:27.697968-0600 Control4[8380:2666118] /Users/realm/workspace/realm_realm-core_release_6.0.6@2/src/realm/util/encrypted_file_mapping.hpp:147: [realm-core-6.0.6] Assertion failed: addr >= m_addr with (addr, m_addr) = [true, true]
        > 0 Realm 0x000000010520c3e1 ZN5realm4utilL18terminate_internalERNSt3_118basic_stringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 28
        > 1 Realm 0x000000010520c68a _ZN5realm4util19terminate_with_infoEPKcS2_lS2_OSt16initializer_listINS0_9PrintableEE + 193
        > 2 Realm 0x00000001051fb954 ZNSt31L20_throw_length_errorEPKc + 0
        > 3 Realm 0x00000001051fb6c8 _ZNK5realm4util20EncryptedFileMapping26get_local_index_of_addressEPKvm + 108
        > 4 Realm 0x00000001051fb714 _ZN5realm4util20EncryptedFileMapping12read_barrierEPKvmPFmPKcE + 34
        > 5 Realm 0x0000000104b3c0b1 _ZN5realm4util26do_encryption_read_barrierEPKvmPFmPKcEPNS0_20EncryptedFileMappingE + 81
        > 6 Realm 0x0000000104b3bf40 _ZN5realm4util23encryption_read_barrierEPKvmPNS0_20EncryptedFileMappingEPFmPKcE + 96
        > 7 Realm 0x0000000104b3bdae _ZNK5realm9Allocator9translateEm + 222
        > 8 Realm 0x0000000105196caf ZNK5realm10IndexArray16index_string_allENS_10StringDataERNSt3_16vectorINS_6ObjKeyENS2_9allocatorIS4_EEEERKNS_13ClusterColumnE + 325
        > 9 Realm 0x0000000104d9e8a5 ZNK5realm11StringIndex8find_allIxEEvRNSt3_16vectorINS_6ObjKeyENS2_9allocatorIS4_EEEET_b + 181
        > 10 Realm 0x00000001050926da _ZN5realm11IntegerNodeINS_12ArrayIntegerENS_5EqualEE4initEv + 104
        > 11 Realm 0x000000010505fef6 _ZNK5realm5Query4initEv + 46
        > 12 Realm 0x000000010505ff8e _ZNK5realm5Query8find_allERNS_14ConstTableViewEmmm + 90
        > 13 Realm 0x00000001051efe82 _ZN5realm14ConstTableView7do_syncEv + 562
        > 14 Realm 0x00000001050602e7 _ZN5realm5Query8find_allEmmm + 81
        > 15 Realm 0x000000010506063d _ZN5realm5Query8find_allERKNS_18DescriptorOrderingE + 243
        > 16 Realm 0x0000000104c77702 _ZN5realm7Results27do_evaluate_query_if_neededEb + 658
        > 17 Realm 0x0000000104c76d95 _ZN5realm7Results7try_getINS_3ObjEEENS_4util8OptionalIT_EEm + 741
        > 18 Realm 0x0000000104c7729c _ZN5realm7Results5firstINS_3ObjEEENS_4util8OptionalIT_EEv + 92
        > 19 Realm 0x0000000104ea52e5 ZZN5realm7Results5firstI18RLMAccessorContextEEDaRT_ENKUlTyS4_E_clIPNS_3ObjEEES3_S4 + 69
        > 20 Realm 0x0000000104ea41c5 ZN5realmL14switch_on_typeINS_3ObjEZNS_7Results5firstI18RLMAccessorContextEEDaRT_EUlTyS6_E_EES5_NS_12PropertyTypeEOT0 + 1429
        > 21 Realm 0x0000000104ea3c27 ZNK5realm7Results8dispatchIZNS0_5firstI18RLMAccessorContextEEDaRT_EUlTyS5_E_EES4_OS5 + 71
        > 22 Realm 0x0000000104ea3bd1 ZN5realm7Results5firstI18RLMAccessorContextEEDaRT + 65
        > 23 Realm 0x0000000104ea3b7e _ZZ25-[RLMResults firstObject]ENK3$_8clEv + 62
        > 24 Realm 0x0000000104e9e697 _ZL25translateRLMResultsErrorsIZ25-[RLMResults firstObject]E3$_8EDaOT_P8NSString + 55
        > 25 Realm 0x0000000104e9e5f7 -[RLMResults firstObject] + 151
        > 26 RealmSwift 0x0000000106f4e364 $s10RealmSwift7ResultsV5firstxSgvg + 132
        > 27 Control4 0x0000000100c5ec25 $s8Control411DataServiceC13getRoomWithID04roomG002C4B3Kit0E0CSgSiSg_tF + 1381
        > 28 Control4 0x0000000100c69e99 $s8Control411DataServiceCAA08LocationC8ProtocolA2aDP13getRoomWithID04roomI002C4B3Kit0G0CSgSiSg_tFTW + 25
        > 29 Control4 0x0000000100e90527 $s8Control420ExperienceHeaderViewC06updateC07forTypeyAA0bcG0O_tF + 13575
        > 30 Control4 0x0000000100ea56e1 $s8Control420ExperienceHeaderViewCAA0bC8ProtocolA2aDP06updateC07forTypeyAA0bcH0O_tFTW + 17
        > 31 Control4 0x000000010076ab6e $s8Control418RoomViewControllerC12updateHeaderyyF + 1518
        > 32 Control4 0x00000001007566c0 $s8Control418RoomViewControllerC14viewWillAppearyySbFyycfU_ + 64
        > 33 C4AppKit 0x0000000107611ca4 $s8C4AppKit18AsyncBlockProtocolPAAE05asyncE0yyyycF + 308
        > 34 Control4 0x0000000100756658 $s8Control418RoomViewControllerC14viewWillAppearyySbF + 408
        > 35 Control4 0x0000000100756758 $s8Control418RoomViewControllerC14viewWillAppearyySbFTo + 56
        > 36 UIKitCore 0x00007fff485e6892 -[UIViewController _setViewAppearState:isAnimating:] + 634
        > 37 UIKitCore 0x00007fff485e6f75 -[UIViewController __viewWillAppear:] + 115
        > 38 UIKitCore 0x00007fff4855ee9f -[UIPageViewController _child:beginAppearanceTransition:animated:] + 99
        > 39 UIKitCore 0x00007fff4855ef99 -[UIPageViewController _child:beginAppearanceTransitionIfPossible:animated:] + 85
        > 40 UIKitCore 0x00007fff48567bf6 -[UIPageViewController queuingScrollView:willManuallyScroll:toRevealView:concealView:animated:] + 479
        > 41 UIKitCore 0x00007fff485739d6 -[_UIQueuingScrollView _notifyDelegateWillManuallyScroll:toRevealView:concealingView:animated:] + 127
        > 42 UIKitCore 0x00007fff48573da3 -[_UIQueuingScrollView setView:direction:animated:completion:] + 358
        > 43 UIKitCore 0x00007fff485651fe -[UIPageViewController _setViewControllers:withScrollInDirection:animated:completion:] + 643
        > 44 UIKitCore 0x00007fff485653a9 -[UIPageViewController setViewControllers:direction:animated:completion:] + 263
        > 45 Control4 0x0000000100faaf8b $s8Control428HomeScreenPageViewControllerC18refreshCurrentRoom4room5pageryAA0iE5ModelVSg_Si5pages_Si12currentIndexttFyycfU_ + 1435
        > 46 Control4 0x00000001005c3340 $sIeg_IeyB_TR + 48
        > 47 libdispatch.dylib 0x000000010c53cf11 _dispatch_call_block_and_release + 12
        > 48 libdispatch.dylib 0x000000010c53de8e _dispatch_client_callout + 8
        > 49 libdispatch.dylib 0x000000010c54bd97 _dispatch_main_queue_callback_4CF + 1149
        > 50 CoreFoundation 0x00007fff23da0909 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9
        > 51 CoreFoundation 0x00007fff23d9b459 __CFRunLoopRun + 2041
        > 52 CoreFoundation 0x00007fff23d9a944 CFRunLoopRunSpecific + 404
        > 53 GraphicsServices 0x00007fff38ba6c1a GSEventRunModal + 139
        > 54 UIKitCore 0x00007fff48c8b9ec UIApplicationMain + 1605
        > 55 Control4 0x0000000100c49a8b main + 75
        > 56 libdyld.dylib 0x00007fff51a231fd start + 1!!! IMPORTANT: Please send this log and info about Realm SDK version and other relevant reproduction info to help@realm.io.

      Steps to Reproduce

      This does involve dispatch queues and groups with calls being made on background threads. Worth noting this code works correctly in both version 3.17 and 4.4x

      Code Sample

      Cannot provide at this time

      Version of Realm and Tooling

      ProductName: Mac OS X
      ProductVersion: 10.15.5
      BuildVersion: 19F101

      /Applications/Xcode.app/Contents/Developer
      Xcode 11.5
      Build version 11E608c

      /usr/local/bin/pod
      (not in use here)

      /bin/bash
      GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)

      /usr/local/bin/carthage
      0.35.0
      (not in use here)

      /usr/local/bin/git
      git version 2.13.0
      Realm framework version: 5.1.0

      Realm Object Server version: ?

      Xcode version: 11.5

      iOS/OSX version: 13.x

      Dependency manager + version: Carthage v 0.35

            Assignee:
            thomas.goyne@mongodb.com Thomas Goyne
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: