realm-core
realm-core copied to clipboard
Assertion failed: ndx < m_size with (ndx, m_size) = [0, 0]
How frequently does the bug occur?
Sometimes
Description
Expected: Results.first
, Results.map
, and Results.count
can be called without crashing.
Actual: All three crash when accessed.
NOTE: I am able to access the realm
property on the Results
object without it crashing.
Stacktrace & log output
The callstack here is triggered when a realm notification occurs on the observed results:
/Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/array.hpp:720: [realm-core-13.17.1] Assertion failed: ndx < m_size with (ndx, m_size) = [0, 0]
0 PROJ 0x00000001044ad688 _ZN5realm4utilL18terminate_internalERNSt3__118basic_stringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 28
1 PROJ 0x00000001044ad668 _ZN5realm4util19terminate_with_infoEPKcS2_lS2_OSt16initializer_listINS0_9PrintableEE + 308
2 PROJ 0x0000000103986444 _ZN5realm4util19terminate_with_infoIJRmRKmEEEvPKciS6_S6_DpOT_ + 152
3 PROJ 0x0000000103c8875c _ZNK5realm5Array3getEm + 160
4 PROJ 0x0000000103d57PROJcbc _ZZNK5realm9BPlusTreeIxE12get_uncachedEmENKUlPNS_13BPlusTreeNodeEmE_clES3_m + 56
5 PROJ 0x0000000103d57c78 _ZZN5realm4util11FunctionRefIFvPNS_13BPlusTreeNodeEmEEC1IRZNKS_9BPlusTreeIxE12get_uncachedEmEUlS3_mE_EEOT_ENKUlPvS3_mE_clESD_S3_m + 44
6 PROJ 0x0000000103d57c40 _ZZN5realm4util11FunctionRefIFvPNS_13BPlusTreeNodeEmEEC1IRZNKS_9BPlusTreeIxE12get_uncachedEmEUlS3_mE_EEOT_ENUlPvS3_mE_8__invokeESD_S3_m + 44
7 PROJ 0x0000000103cdb1cc _ZNK5realm4util11FunctionRefIFvPNS_13BPlusTreeNodeEmEEclES3_m + 48
8 PROJ 0x0000000103cdb7d0 _ZN5realm14BPlusTreeInner13bptree_accessEmNS_4util11FunctionRefIFvPNS_13BPlusTreeNodeEmEEE + 432
9 PROJ 0x0000000103d57b74 _ZNK5realm9BPlusTreeIxE12get_uncachedEm + 100
10 PROJ 0x0000000103d48734 _ZNK5realm9BPlusTreeIxE3getEm + 124
11 PROJ 0x00000001041411e4 _ZNK5realm14IndexEvaluator12get_internalEm + 108
12 PROJ 0x00000001041c43f0 _ZN5realm14IndexEvaluator15do_search_indexEPKNS_7ClusterEmm + 164
13 PROJ 0x0000000104161e8c _ZN5realm8BoolNodeINS_5EqualEE16find_first_localEmm + 80
14 PROJ 0x00000001041c3938 _ZN5realm10ParentNode10find_firstEmm + 124
15 PROJ 0x00000001041ce710 _ZZN5realm10ParentNode5matchERKNS_3ObjEENK3$_0clEPKNS_7ClusterEm + 64
16 PROJ 0x00000001041c3b10 _ZNK5realm3Obj8evaluateIZNS_10ParentNode5matchERKS0_E3$_0EEbT_ + 248
17 PROJ 0x00000001041c3a08 _ZN5realm10ParentNode5matchERKNS_3ObjE + 40
18 PROJ 0x00000001041388c8 _ZNK5realm5Query11eval_objectERKNS_3ObjE + 80
19 PROJ 0x0000000103bce980 _ZZN5realm13SubQueryCount8evaluateEmRNS_9ValueBaseEENKUlmNS_6ObjKeyEE_clEmS3_ + 112
20 PROJ 0x0000000103bce8ec _ZNSt3__110accumulateB6v15006INS_11__wrap_iterIPN5realm6ObjKeyEEEmZNS2_13SubQueryCount8evaluateEmRNS2_9ValueBaseEEUlmS3_E_EET0_T_SB_SA_T1_ + 92
21 PROJ 0x0000000103bce610 _ZN5realm13SubQueryCount8evaluateEmRNS_9ValueBaseE + 176
22 PROJ 0x0000000103ab4e40 _ZNK5realm7CompareINS_4LessEE10find_firstEmm + 468
23 PROJ 0x00000001041c873c _ZN5realm14ExpressionNode16find_first_localEmm + 56
24 PROJ 0x00000001041c3938 _ZN5realm10ParentNode10find_firstEmm + 124
25 PROJ 0x00000001041be764 _ZN5realm6OrNode16find_first_localEmm + 580
26 PROJ 0x00000001041c3e70 _ZN5realm10ParentNode14find_all_localEmm + 84
27 PROJ 0x00000001041c3bc8 _ZN5realm10ParentNode15aggregate_localEPNS_14QueryStateBaseEmmmPNS_12ArrayPayloadE + 112
28 PROJ 0x0000000104138b70 _ZNK5realm5Query18aggregate_internalEPNS_10ParentNodeEPNS_14QueryStateBaseEmmPNS_12ArrayPayloadE + 164
29 PROJ 0x00000001041414a8 _ZZNK5realm5Query11do_find_allERNS_14QueryStateBaseEENK3$_3clEPKNS_7ClusterE + 152
30 PROJ 0x0000000104141404 _ZZN5realm4util11FunctionRefIFNS_15IteratorControlEPKNS_7ClusterEEEC1IRZNKS_5Query11do_find_allERNS_14QueryStateBaseEE3$_3EEOT_ENKUlPvS5_E_clESG_S5_ + 36
31 PROJ 0x00000001041413d4 _ZZN5realm4util11FunctionRefIFNS_15IteratorControlEPKNS_7ClusterEEEC1IRZNKS_5Query11do_find_allERNS_14QueryStateBaseEE3$_3EEOT_ENUlPvS5_E_8__invokeESG_S5_ + 36
32 PROJ 0x0000000103d0a224 _ZNK5realm4util11FunctionRefIFNS_15IteratorControlEPKNS_7ClusterEEEclES5_ + 40
33 PROJ 0x0000000103d0b278 _ZNK5realm11ClusterTree8traverseENS_4util11FunctionRefIFNS_15IteratorControlEPKNS_7ClusterEEEE + 80
34 PROJ 0x000000010413a1c8 _ZNK5realm5Table17traverse_clustersENS_4util11FunctionRefIFNS_15IteratorControlEPKNS_7ClusterEEEE + 52
35 PROJ 0x000000010413a770 _ZNK5realm5Query11do_find_allERNS_14QueryStateBaseE + 1248
36 PROJ 0x000000010443b690 _ZN5realm9TableView7do_syncEv + 1028
37 PROJ 0x000000010443b27c _ZNK5realm9TableView14sync_if_neededEv + 44
38 PROJ 0x0000000103f59928 _ZN5realm7Results17ensure_up_to_dateENS0_12EvaluateModeE + 1768
39 PROJ 0x0000000103f5bed4 _ZN5realm7Results7try_getINS_3ObjEEENSt3__18optionalIT_EEm + 68
40 PROJ 0x0000000103f5c254 _ZN5realm7Results5firstINS_3ObjEEENSt3__18optionalIT_EEv + 56
41 PROJ 0x0000000103c09960 _ZZN5realm7Results5firstI18RLMAccessorContextEEDaRT_ENKUlS4_E_clIPNS_3ObjEEES3_S4_ + 44
42 PROJ 0x0000000103c08a40 _ZN5realmL14switch_on_typeINS_3ObjEZNS_7Results5firstI18RLMAccessorContextEEDaRT_EUlS6_E_EES5_NS_12PropertyTypeEOT0_ + 1412
43 PROJ 0x0000000103c084b0 _ZNK5realm7Results8dispatchIZNS0_5firstI18RLMAccessorContextEEDaRT_EUlS5_E_EES4_OS5_ + 40
44 PROJ 0x0000000103c0847c _ZN5realm7Results5firstI18RLMAccessorContextEEDaRT_ + 44
45 PROJ 0x0000000103c08444 _ZZ25-[RLMResults firstObject]ENK3$_8clEv + 40
46 PROJ 0x0000000103c08390 _ZL24translateCollectionErrorIZ25-[RLMResults firstObject]E3$_8EDaOT_P8NSString + 36
47 PROJ 0x0000000103c04868 -[RLMResults firstObject] + 140
48 PROJ 0x000000010472ab1c $s10RealmSwift0A14CollectionImplPAAE5first7ElementQzSgvg + 188
49 PROJ 0x000000010362f240 $s10PROJ16JobYearViewModelC14updateSnapshot33_4212562AF5409B0857F540B19D5A65C0LLyyF + 1332
50 PROJ 0x000000010362dbcc $s10PROJ16JobYearViewModelC17snapshotThrottler33_4212562AF5409B0857F540B19D5A65C0LL6Common8ThrottleCyytGvgAIyXEfU_yycfU_ + 152
51 PROJ 0x0000000102f39600 $sIeg_ytIegn_TR + 20
52 Common 0x000000010b7f8518 $s6Common8ThrottleC19dequeuePendingValue33_16567064C9D1FEC29219BDDD3527C626LLyyF + 408
53 Common 0x000000010b7f7b50 $s6Common8ThrottleC12pendingValue33_16567064C9D1FEC29219BDDD3527C626LLxSgvWyyScMYccfU_ + 48
54 Common 0x000000010b7f7b90 $sIeg_IeyB_TR + 48
55 libdispatch.dylib 0x000000010bb80520 _dispatch_call_block_and_release + 32
56 libdispatch.dylib 0x000000010bb82038 _dispatch_client_callout + 20
57 libdispatch.dylib 0x000000010bb92798 _dispatch_main_queue_drain + 1196
58 libdispatch.dylib 0x000000010bb922dc _dispatch_main_queue_callback_4CF + 44
59 CoreFoundation 0x00000001a367fc28 A900B459-0127-379E-9CBA-0EAB9C5D559F + 625704
60 CoreFoundation 0x00000001a3661560 A900B459-0127-379E-9CBA-0EAB9C5D559F + 501088
61 CoreFoundation 0x00000001a36663ec CFRunLoopRunSpecific + 612
62 GraphicsServices 0x00000001deb7c35c GSEventRunModal + 164
63 UIKitCore 0x00000001a59f2f58 7D57A1D1-856F-338D-97DB-880C4EC8B02E + 3788632
64 UIKitCore 0x00000001a59f2bbc UIApplicationMain + 340
65 PROJ 0x0000000102a69e98 main + 156
66 dyld 0x00000001c2b98dec C3FC2EE4-367F-3086-BEB8-420AD442BF88 + 89580
!!! IMPORTANT: Please report this at https://github.com/realm/realm-core/issues/new/choose2023-08-06 13:24:55.054919-0700 PROJ[1727:580948] /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/array.hpp:720: [realm-core-13.17.1] Assertion failed: ndx < m_size with (ndx, m_size) = [0, 0]
0 PROJ 0x00000001044ad688 _ZN5realm4utilL18terminate_internalERNSt3__118basic_stringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 28
1 PROJ 0x00000001044ad668 _ZN5realm4util19terminate_with_infoEPKcS2_lS2_OSt16initializer_listINS0_9PrintableEE + 308
2 PROJ 0x0000000103986444 _ZN5realm4util19terminate_with_infoIJRmRKmEEEvPKciS6_S6_DpOT_ + 152
3 PROJ 0x0000000103c8875c _ZNK5realm5Array3getEm + 160
4 PROJ 0x0000000103d57cbc _ZZNK5realm9BPlusTreeIxE12get_uncachedEmENKUlPNS_13BPlusTreeNodeEmE_clES3_m + 56
5 PROJ 0x0000000103d57c78 _ZZN5realm4util11FunctionRefIFvPNS_13BPlusTreeNodeEmEEC1IRZNKS_9BPlusTreeIxE12get_uncachedEmEUlS3_mE_EEOT_ENKUlPvS3_mE_clESD_S3_m + 44
6 PROJ 0x0000000103d57c40 _ZZN5realm4util11FunctionRefIFvPNS_13BPlusTreeNodeEmEEC1IRZNKS_9BPlusTreeIxE12get_uncachedEmEUlS3_mE_EEOT_ENUlPvS3_mE_8__invokeESD_S3_m + 44
7 PROJ 0x0000000103cdb1cc _ZNK5realm4util11FunctionRefIFvPNS_13BPlusTreeNodeEmEEclES3_m + 48
8 PROJ 0x0000000103cdb7d0 _ZN5realm14BPlusTreeInner13bptree_accessEmNS_4util11FunctionRefIFvPNS_13BPlusTreeNodeEmEEE + 432
9 PROJ 0x0000000103d57b74 _ZNK5realm9BPlusTreeIxE12get_uncachedEm + 100
10 PROJ 0x0000000103d48734 _ZNK5realm9BPlusTreeIxE3getEm + 124
11 PROJ 0x00000001041411e4 _ZNK5realm14IndexEvaluator12get_internalEm + 108
12 PROJ 0x00000001041c43f0 _ZN5realm14IndexEvaluator15do_search_indexEPKNS_7ClusterEmm + 164
13 PROJ 0x0000000104161e8c _ZN5realm8BoolNodeINS_5EqualEE16find_first_localEmm + 80
14 PROJ 0x00000001041c3938 _ZN5realm10ParentNode10find_firstEmm + 124
15 PROJ 0x00000001041ce710 _ZZN5realm10ParentNode5matchERKNS_3ObjEENK3$_0clEPKNS_7ClusterEm + 64
16 PROJ 0x00000001041c3b10 _ZNK5realm3Obj8evaluateIZNS_10ParentNode5matchERKS0_E3$_0EEbT_ + 248
17 PROJ 0x00000001041c3a08 _ZN5realm10ParentNode5matchERKNS_3ObjE + 40
18 PROJ 0x00000001041388c8 _ZNK5realm5Query11eval_objectERKNS_3ObjE + 80
19 PROJ 0x0000000103bce980 _ZZN5realm13SubQueryCount8evaluateEmRNS_9ValueBaseEENKUlmNS_6ObjKeyEE_clEmS3_ + 112
20 PROJ 0x0000000103bce8ec _ZNSt3__110accumulateB6v15006INS_11__wrap_iterIPN5realm6ObjKeyEEEmZNS2_13SubQueryCount8evaluateEmRNS2_9ValueBaseEEUlmS3_E_EET0_T_SB_SA_T1_ + 92
21 PROJ 0x0000000103bce610 _ZN5realm13SubQueryCount8evaluateEmRNS_9ValueBaseE + 176
22 PROJ 0x0000000103ab4e40 _ZNK5realm7CompareINS_4LessEE10find_firstEmm + 468
23 PROJ 0x00000001041c873c _ZN5realm14ExpressionNode16find_first_localEmm + 56
24 PROJ 0x00000001041c3938 _ZN5realm10ParentNode10find_firstEmm + 124
25 PROJ 0x00000001041be764 _ZN5realm6OrNode16find_first_localEmm + 580
26 PROJ 0x00000001041c3e70 _ZN5realm10ParentNode14find_all_localEmm + 84
27 PROJ 0x00000001041c3bc8 _ZN5realm10ParentNode15aggregate_localEPNS_14QueryStateBaseEmmmPNS_12ArrayPayloadE + 112
28 PROJ 0x0000000104138b70 _ZNK5realm5Query18aggregate_internalEPNS_10ParentNodeEPNS_14QueryStateBaseEmmPNS_12ArrayPayloadE + 164
29 PROJ 0x00000001041414a8 _ZZNK5realm5Query11do_find_allERNS_14QueryStateBaseEENK3$_3clEPKNS_7ClusterE + 152
30 PROJ 0x0000000104141404 _ZZN5realm4util11FunctionRefIFNS_15IteratorControlEPKNS_7ClusterEEEC1IRZNKS_5Query11do_find_allERNS_14QueryStateBaseEE3$_3EEOT_ENKUlPvS5_E_clESG_S5_ + 36
31 PROJ 0x00000001041413d4 _ZZN5realm4util11FunctionRefIFNS_15IteratorControlEPKNS_7ClusterEEEC1IRZNKS_5Query11do_find_allERNS_14QueryStateBaseEE3$_3EEOT_ENUlPvS5_E_8__invokeESG_S5_ + 36
32 PROJ 0x0000000103d0a224 _ZNK5realm4util11FunctionRefIFNS_15IteratorControlEPKNS_7ClusterEEEclES5_ + 40
33 PROJ 0x0000000103d0b278 _ZNK5realm11ClusterTree8traverseENS_4util11FunctionRefIFNS_15IteratorControlEPKNS_7ClusterEEEE + 80
34 PROJ 0x000000010413a1c8 _ZNK5realm5Table17traverse_clustersENS_4util11FunctionRefIFNS_15IteratorControlEPKNS_7ClusterEEEE + 52
35 PROJ 0x000000010413a770 _ZNK5realm5Query11do_find_allERNS_14QueryStateBaseE + 1248
36 PROJ 0x000000010443b690 _ZN5realm9TableView7do_syncEv + 1028
37 PROJ 0x000000010443b27c _ZNK5realm9TableView14sync_if_neededEv + 44
38 PROJ 0x0000000103f59928 _ZN5realm7Results17ensure_up_to_dateENS0_12EvaluateModeE + 1768
39 PROJ 0x0000000103f5bed4 _ZN5realm7Results7try_getINS_3ObjEEENSt3__18optionalIT_EEm + 68
40 PROJ 0x0000000103f5c254 _ZN5realm7Results5firstINS_3ObjEEENSt3__18optionalIT_EEv + 56
41 PROJ 0x0000000103c09960 _ZZN5realm7Results5firstI18RLMAccessorContextEEDaRT_ENKUlS4_E_clIPNS_3ObjEEES3_S4_ + 44
42 PROJ 0x0000000103c08a40 _ZN5realmL14switch_on_typeINS_3ObjEZNS_7Results5firstI18RLMAccessorContextEEDaRT_EUlS6_E_EES5_NS_12PropertyTypeEOT0_ + 1412
43 PROJ 0x0000000103c084b0 _ZNK5realm7Results8dispatchIZNS0_5firstI18RLMAccessorContextEEDaRT_EUlS5_E_EES4_OS5_ + 40
44 PROJ 0x0000000103c0847c _ZN5realm7Results5firstI18RLMAccessorContextEEDaRT_ + 44
45 PROJ 0x0000000103c08444 _ZZ25-[RLMResults firstObject]ENK3$_8clEv + 40
46 PROJ 0x0000000103c08390 _ZL24translateCollectionErrorIZ25-[RLMResults firstObject]E3$_8EDaOT_P8NSString + 36
47 PROJ 0x0000000103c04868 -[RLMResults firstObject] + 140
48 PROJ 0x000000010472ab1c $s10RealmSwift0A14CollectionImplPAAE5first7ElementQzSgvg + 188
49 PROJ 0x000000010362f240 $s10PROJ16JobYearViewModelC14updateSnapshot33_4212562AF5409B0857F540B19D5A65C0LLyyF + 1332
50 PROJ 0x000000010362dbcc $s10PROJ16JobYearViewModelC17snapshotThrottler33_4212562AF5409B0857F540B19D5A65C0LL6Common8ThrottleCyytGvgAIyXEfU_yycfU_ + 152
51 PROJ 0x0000000102f39600 $sIeg_ytIegn_TR + 20
52 Common 0x000000010b7f8518 $s6Common8ThrottleC19dequeuePendingValue33_16567064C9D1FEC29219BDDD3527C626LLyyF + 408
53 Common 0x000000010b7f7b50 $s6Common8ThrottleC12pendingValue33_16567064C9D1FEC29219BDDD3527C626LLxSgvWyyScMYccfU_ + 48
54 Common 0x000000010b7f7b90 $sIeg_IeyB_TR + 48
55 libdispatch.dylib 0x000000010bb80520 _dispatch_call_block_and_release + 32
56 libdispatch.dylib 0x000000010bb82038 _dispatch_client_callout + 20
57 libdispatch.dylib 0x000000010bb92798 _dispatch_main_queue_drain + 1196
58 libdispatch.dylib 0x000000010bb922dc _dispatch_main_queue_callback_4CF + 44
59 CoreFoundation 0x00000001a367fc28 A900B459-0127-379E-9CBA-0EAB9C5D559F + 625704
60 CoreFoundation 0x00000001a3661560 A900B459-0127-379E-9CBA-0EAB9C5D559F + 501088
61 CoreFoundation 0x00000001a36663ec CFRunLoopRunSpecific + 612
62 GraphicsServices 0x00000001deb7c35c GSEventRunModal + 164
63 UIKitCore 0x00000001a59f2f58 7D57A1D1-856F-338D-97DB-880C4EC8B02E + 3788632
64 UIKitCore 0x00000001a59f2bbc UIApplicationMain + 340
65 PROJ 0x0000000102a69e98 main + 156
66 dyld 0x00000001c2b98dec C3FC2EE4-367F-3086-BEB8-420AD442BF88 + 89580
!!! IMPORTANT: Please report this at https://github.com/realm/realm-core/issues/new/choose
The above call stack is triggered by a write. Here is the call stack that triggers the observe block:
realm/realm-swift#7 0x0000000104a86704 in wrapped realm/realm-swift#1 <τ_0_0>(collection:change:error:) in RealmCollectionImpl.observe(keyPaths:on:_:) at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-cocoa/RealmSwift/Impl/RealmCollectionImpl.swift:118
realm/realm-swift#8 0x0000000104a868b0 in partial apply for wrapped realm/realm-swift#1 <τ_0_0>(collection:change:error:) in RealmCollectionImpl.observe(keyPaths:on:_:) ()
realm/realm-swift#9 0x0000000104a35264 in thunk for @escaping @callee_guaranteed (@guaranteed RLMResults<Swift.AnyObject>?, @guaranteed RLMCollectionChange?, @guaranteed Error?) -> () ()
realm/realm-swift#10 0x0000000103d4f130 in (anonymous namespace)::CollectionCallbackWrapper::operator()(realm::CollectionChangeSet const&) at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-cocoa/Realm/RLMCollection.mm:457
realm/realm-swift#11 0x0000000103d4ef9c in realm::CollectionChangeCallback::Impl<(anonymous namespace)::CollectionCallbackWrapper>::after(realm::CollectionChangeSet const&) at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/object-store/collection_notifications.hpp:195
realm/realm-swift#12 0x0000000104234e80 in realm::CollectionChangeCallback::after(realm::CollectionChangeSet const&) at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/object-store/collection_notifications.hpp:150
realm/realm-swift#13 0x0000000104234dd0 in auto realm::_impl::CollectionNotifier::after_advance()::$_6::operator()<realm::util::CheckedUniqueLock, realm::_impl::NotificationCallback>(realm::util::CheckedUniqueLock&, realm::_impl::NotificationCallback&) const at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/object-store/impl/collection_notifier.cpp:335
realm/realm-swift#14 0x0000000104228098 in void realm::_impl::CollectionNotifier::for_each_callback<realm::_impl::CollectionNotifier::after_advance()::$_6>(realm::_impl::CollectionNotifier::after_advance()::$_6&&) at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/object-store/impl/collection_notifier.cpp:369
realm/realm-swift#15 0x0000000104227fc0 in realm::_impl::CollectionNotifier::after_advance() at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/object-store/impl/collection_notifier.cpp:323
realm/realm-swift#16 0x0000000104228bd8 in realm::_impl::NotifierPackage::after_advance() at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/object-store/impl/collection_notifier.cpp:471
realm/realm-swift#17 0x0000000104275548 in void (anonymous namespace)::advance_with_notifications<realm::_impl::transaction::begin(std::__1::shared_ptr<realm::Transaction> const&, realm::BindingContext*, realm::_impl::NotifierPackage&&)::$_2>(realm::BindingContext*, std::__1::shared_ptr<realm::Transaction> const&, realm::_impl::transaction::begin(std::__1::shared_ptr<realm::Transaction> const&, realm::BindingContext*, realm::_impl::NotifierPackage&&)::$_2&&, realm::_impl::NotifierPackage&) at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/object-store/impl/transact_log_handler.cpp:556
realm/realm-swift#18 0x00000001042751b4 in realm::_impl::transaction::begin(std::__1::shared_ptr<realm::Transaction> const&, realm::BindingContext*, realm::_impl::NotifierPackage&&) at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/object-store/impl/transact_log_handler.cpp:591
realm/realm-swift#19 0x00000001042554fc in realm::_impl::RealmCoordinator::promote_to_write(realm::Realm&) at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/object-store/impl/realm_coordinator.cpp:1151
realm/realm-swift#20 0x000000010437dff8 in realm::Realm::do_begin_transaction() at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/object-store/shared_realm.cpp:1005
realm/realm-swift#21 0x000000010437dbf0 in realm::Realm::run_writes() at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/object-store/shared_realm.cpp:814
realm/realm-swift#22 0x000000010426e498 in realm::Realm::Internal::run_writes(realm::Realm&) at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/object-store/shared_realm.hpp:472
realm/realm-swift#23 0x000000010426e474 in realm::_impl::RealmCoordinator::async_request_write_mutex(realm::Realm&)::$_9::operator()()::'lambda'()::operator()() const at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/object-store/impl/realm_coordinator.cpp:1250
realm/realm-swift#24 0x000000010426e3d0 in realm::util::UniqueFunction<void ()>::SpecificImpl<realm::_impl::RealmCoordinator::async_request_write_mutex(realm::Realm&)::$_9::operator()()::'lambda'()>::call() at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/util/functional.hpp:154
realm/realm-swift#25 0x000000010407cd3c in realm::util::UniqueFunction<void ()>::operator()() const at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/util/functional.hpp:94
realm/realm-swift#26 0x000000010447a304 in realm::util::InvocationQueue::invoke_all() at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/object-store/util/scheduler.cpp:105
realm/realm-swift#27 0x000000010447ab78 in realm::util::RunLoopScheduler::RunLoopScheduler(__CFRunLoop*)::$_0::operator()(void*) const at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/object-store/util/apple/scheduler.hpp:67
realm/realm-swift#28 0x000000010447ab50 in realm::util::RunLoopScheduler::RunLoopScheduler(__CFRunLoop*)::$_0::__invoke(void*) at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/object-store/util/apple/scheduler.hpp:66
Can you reproduce the bug?
Sometimes
Reproduction Steps
Unfortunately, our app is so complex that I couldn't even tell you how to reproduce it.
Version
10.42.0
What Atlas Services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
iPhone 14 Pro (physical) iOS 16.6, iPhone 14 Pro (simulator) iOS 16.4
Build environment
Xcode version: 14.3.1 Dependency manager and version: Swift Package Manager
I just noticed that I am seeing two different assertions. This is the second one:
/Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/alloc.hpp:426: [realm-core-13.17.1] Assertion failed: v % 8 == 0 with (v) = [1347769685]
Let me know if you'd like for me to create another issue with the relevant stack trace. I just thought it might help to show you that I see both assertions, and not one of them occurs more than the other.
It is highly possible that you are experiencing a crash due to some corruption that we fixed in core 13.20.1. You are using async writes:
realm/realm-swift#21 0x000000010437dbf0 in realm::Realm::run_writes() at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/object-store/shared_realm.cpp:814
realm/realm-swift#22 0x000000010426e498 in realm::Realm::Internal::run_writes(realm::Realm&) at /Users/rob/Library/Developer/Xcode/DerivedData/PROJ-apmilanlxdaqowehxscxlwtxrcbs/SourcePackages/checkouts/realm-core/src/realm/object-store/shared_realm.hpp:472
realm/realm-swift#23 0x000000010426e474 in realm::_impl::RealmCoordinator::async_request_write_mutex(realm:
And getting weird errors coming from the Array header, which usually means that you are reading some part of the file that is rubbish. This is what it has been fixed in https://github.com/realm/realm-core/pull/6962. I am going to close this issue for now, assuming that it was fixed by the pull request I mentioned, but feel free to reopen the issue if you keep experiencing the same errors.