Skip to content

Realm-Swift crash in Array::get_context_flag_from_header after updating to iOS 26.2 #8092

Description

@fizzlepuppy

SDK and version

SDK : Realm Swift
Version: 10.54.6 (also occurs on 10.32.0)

Observations

  • How frequent do the crash occur?
    Anytime I try and init a Realm database.

  • Does it happen in production or during dev/test?
    Prod

  • Can the crash be reproduced by you?
    Yes

  • Can you provide instructions for how we can reproduce it?
    It seems like running on iOS 26.2 is when this started to show up.

Crash log / stacktrace

/Users/runner/work/realm-swift/realm-swift/core/src/realm/index_string.hpp:293: [realm-core-14.14.0] Assertion failed: Array::get_context_flag_from_header(alloc.translate(ref)) with (ref, size_t(alloc.translate(ref))) =  [1677384, 4511160392]
0   Realm                               0x00000001053f40ac _ZN5realm4utilL18terminate_internalERNSt3__118basic_stringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 32
1   Realm                               0x00000001053f4024 _ZN5realm4util19terminate_with_infoEPKcS2_lS2_OSt16initializer_listINS0_9PrintableEE + 396
2   Realm                               0x00000001052bbf10 _ZN5realm11GroupWriter29move_free_in_file_to_size_mapERKNSt3__16vectorINS0_14FreeSpaceEntryENS1_9allocatorIS3_EEEERNS1_8multimapImmNS1_4lessImEENS4_INS1_4pairIKmmEEEEEE + 0
3   Realm                               0x00000001052c877c _ZN5realm11StringIndexC1EmPNS_11ArrayParentEmRKNS_13ClusterColumnERNS_9AllocatorE + 356
4   Realm                               0x00000001053b1a60 _ZN5realm5Table23refresh_index_accessorsEv + 508
5   Realm                               0x00000001052b4584 _ZN5realm5Group21create_table_accessorEm + 900
6   Realm                               0x00000001052b41a8 _ZN5realm5Group12do_get_tableEm + 120
7   Realm                               0x00000001053cf270 _ZN5realm11Transaction19upgrade_file_formatEi + 860
8   Realm                               0x0000000105294f68 _ZN5realm2DB19upgrade_file_formatEbiii + 280
9   Realm                               0x00000001052934f4 _ZN5realm2DB4openERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_9DBOptionsE + 5200
10  Realm                               0x000000010529a358 _ZN5realm2DB6createENSt3__110unique_ptrINS_11ReplicationENS1_14default_deleteIS3_EEEERKNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS_9DBOptionsE + 164
11  Realm                               0x00000001054ea8e4 _ZN5realm5_impl16RealmCoordinator7open_dbEv + 1012
12  Realm                               0x00000001054eb628 _ZN5realm5_impl16RealmCoordinator12do_get_realmEONS_11RealmConfigERNSt3__110shared_ptrINS_5RealmEEENS4_8optionalINS_9VersionIDEEERNS_4util17CheckedUniqueLockEb + 76
13  Realm                               0x00000001054eb544 _ZN5realm5_impl16RealmCoordinator9get_realmENS_11RealmConfigENSt3__18optionalINS_9VersionIDEEE + 484
14  Realm                               0x0000000105535094 _ZN5realm5Realm16get_shared_realmENS_11RealmConfigE + 120
15  Realm                               0x00000001051bb568 +[RLMRealm realmWithConfiguration:confinedTo:error:] + 952
16  Realm                               0x00000001051bb0ac +[RLMRealm realmWithConfiguration:queue:error:] + 156
17  RealmSwift                          0x000000010413fe48 $sSo8RLMRealmC13configuration5queueABSo0A13ConfigurationC_So012OS_dispatch_C0CSgtKcfCTO + 152
18  RealmSwift                          0x00000001041ed3d0 $s10RealmSwift0A0V13configuration5queueA2C13ConfigurationV_So012OS_dispatch_D0CSgtKcfC + 124
19  Crinkles.debug.dylib                0x00000001039ed7b0 $s8Crinkles13RealmProviderC5realm0B5Swift0B0VyF + 152
20  Crinkles.debug.dylib                0x000000010399f240 $s8Crinkles12VersionModelC07versionC033_C3780D180505F4AF68E859422EDF01B8LL3forACSgAC0B4TypeO_tFZ + 92
21  Crinkles.debug.dylib                0x000000010399f160 $s8Crinkles12VersionModelC7version3forSiSgAC0B4TypeO_tFZ + 48
22  Crinkles.debug.dylib                0x0000000103907a50 $s8Crinkles15ModelControllerC12brandVersionSiSgvg + 44
23  Crinkles.debug.dylib                0x0000000103907e68 $s8Crinkles15ModelControllerC10loadBrands33_99B6229989702B30755BD2CDC61F6CD4LL4fromSbSDySSypG_tKF + 368
24  Crinkles.debug.dylib                0x0000000103907bf4 $s8Crinkles15ModelControllerC15loadInitialDatayyFyyXEfU_ + 64
25  Crinkles.debug.dylib                0x0000000103908b1c $sIg_Ieg_TR + 20
26  Crinkles.debug.dylib                0x0000000103908b40 $sIeg_IyB_TR + 24
27  libdispatch.dylib                   0x0000000103571d6c _dispatch_client_callout + 16
28  libdispatch.dylib                   0x0000000103568e0c _dispatch_lane_barrier_sync_invoke_and_complete + 172
29  Crinkles.debug.dylib                0x0000000103907b48 $s8Crinkles15ModelControllerC15loadInitialDatayyF + 228
30  Crinkles.debug.dylib                0x00000001039eadfc $s8Crinkles15RootCoordinatorC9bootstrap16skippingDBUpdateySb_tF + 444
31  Crinkles.debug.dylib                0x0000000103957294 $s8Crinkles13SceneDelegateC5scene_13willConnectTo7optionsySo7UISceneC_So0I7SessionCSo0I17ConnectionOptionsCtF + 612
32  Crinkles.debug.dylib                0x0000000103957698 $s8Crinkles13SceneDelegateC5scene_13willConnectTo7optionsySo7UISceneC_So0I7SessionCSo0I17ConnectionOptionsCtFTo + 116
33  UIKitCore                           0x000000019875b428 15414C36-D442-3F06-96CD-791887BE07FC + 259112
34  UIKitCore                           0x00000001988632a0 15414C36-D442-3F06-96CD-791887BE07FC + 1340064
35  UIKitCore                           0x0000000198858d30 15414C36-D442-3F06-96CD-791887BE07FC + 1297712
36  UIKitCore                           0x0000000198863e58 15414C36-D442-3F06-96CD-791887BE07FC + 1343064
37  FrontBoardServices                  0x00000001b3f42734 5949593B-27F4-3693-9310-5754D69E08AE + 153396
38  FrontBoardServices                  0x00000001b3f3d8ac 5949593B-27F4-3693-9310-5754D69E08AE + 133292
39  FrontBoardServices                  0x00000001b3f424d8 5949593B-27F4-3693-9310-5754D69E08AE + 152792
40  FrontBoardServices                  0x00000001b3f41c0c 5949593B-27F4-3693-9310-5754D69E08AE + 150540
41  FrontBoardServices                  0x00000001b3f415b0 5949593B-27F4-3693-9310-5754D69E08AE + 148912
42  FrontBoardServices                  0x00000001b3f41928 5949593B-27F4-3693-9310-5754D69E08AE + 149800
43  FrontBoardServices                  0x00000001b3f41724 5949593B-27F4-3693-9310-5754D69E08AE + 149284
44  FrontBoardServices                  0x00000001b3f415b0 5949593B-27F4-3693-9310-5754D69E08AE + 148912
45  libdispatch.dylib                   0x0000000103571d6c _dispatch_client_callout + 16
46  libdispatch.dylib                   0x000000010355c4c0 _dispatch_block_invoke_direct + 296
47  BoardServices                       0x00000001ab5a4f84 3D4773ED-61BF-3159-9081-D0564508FE7A + 180100
48  BoardServices                       0x00000001ab5a4e00 3D4773ED-61BF-3159-9081-D0564508FE7A + 179712
49  CoreFoundation                      0x0000000192c4adec B8C4A762-0973-3240-B782-850DB2A1FBB3 + 654828
50  CoreFoundation                      0x0000000192c4ad60 B8C4A762-0973-3240-B782-850DB2A1FBB3 + 654688
51  CoreFoundation                      0x0000000192c100ac B8C4A762-0973-3240-B782-850DB2A1FBB3 + 413868
52  CoreFoundation                      0x0000000192bd9e30 B8C4A762-0973-3240-B782-850DB2A1FBB3 + 192048
53  CoreFoundation                      0x0000000192bd91dc B8C4A762-0973-3240-B782-850DB2A1FBB3 + 188892
54  GraphicsServices                    0x00000002394cb498 GSEventRunModal + 120
55  UIKitCore                           0x000000019883cd18 15414C36-D442-3F06-96CD-791887BE07FC + 1183000
56  UIKitCore                           0x00000001987a8068 UIApplicationMain + 332
57  Crinkles.debug.dylib                0x0000000103a01884 __debug_main_executable_dylib_entry_point + 64
58  dyld                                0x000000018fae4e3c 1D1E19AC-4807-39F1-80FB-D27A4C2C61C0 + 20028
!!! IMPORTANT: Please report this at https://github.com/realm/realm-core/issues/new/choose

Steps & Code to Reproduce

I can attach my database if that would be helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions