Skip to content

Compile failed: SIL memory lifetime failure, memory is initialized, but shouldn't be #85729

@SakuragoTeacher

Description

@SakuragoTeacher

Description

When using the locally compiled version 6.2.1-RELEASE toolchain to build Release or Archive for an IOS project that uses specific dependencies, compilation failure may occur, while using XcodeDefault toolchain it can be successfuly built.

Reproduction

Just create a swift projcet and add package dependencies "swift-transformers" from https://github.com/huggingface/swift-transformers.git, then build Release or Archive, compilation failure may occur during Compile Tokenizers.
The following is code where compilation crashes. The issue only occurs within the complete dependency package, adding this code separately will not cause any problems.
However, I successfully compiled it by removing the lazy tag and initializing it on the first call to Next(). This may be an issue caused by Swift's handling of lazy and generic types.

// in swift-transformers/Sources/Tokenizers/Tire.swift
class TrieNode<T: Hashable> {
    var isLeaf: Bool = false
    var children: [T: TrieNode] = [:]
}

struct LeavesWithCommonPrefixIterator<T: Hashable>: Sequence, IteratorProtocol {
    var node: TrieNode<T>
    var text: any Sequence<T>
    var seq: [T] = []
    lazy var iterator = text.makeIterator() as any IteratorProtocol<T>

    mutating func next() -> [T]? {
        while true {
            guard let item = iterator.next() else { return nil }
            seq.append(item)
            guard let child = node.children[item] else { return nil }
            node = child
            if node.isLeaf {
                return seq
            }
        }
    }
}

the minimal reproducting project is attached here.
ios-swift-test-SIL.zip

Stack dump

SIL memory lifetime failure in @$sSTsE3mapySayqd__Gqd__7ElementQzqd_0_YKXEqd_0_YKs5ErrorRd_0_r0_lF10Tokenizers30LeavesWithCommonPrefixIteratorVySJG_SSs5NeverOTg5: memory is initialized, but shouldn't be
memory location:   %16 = init_enum_data_addr %15 : $*Optional<any IteratorProtocol<Character>>, #Optional.some!enumelt // user: %28
at instruction:   %16 = init_enum_data_addr %15 : $*Optional<any IteratorProtocol<Character>>, #Optional.some!enumelt // user: %28

in function:
// specialized Sequence.map<A, B>(_:)
sil shared [ossa] @$sSTsE3mapySayqd__Gqd__7ElementQzqd_0_YKXEqd_0_YKs5ErrorRd_0_r0_lF10Tokenizers30LeavesWithCommonPrefixIteratorVySJG_SSs5NeverOTg5 : $@convention(method) (@guaranteed @noescape @callee_guaranteed @substituted <τ_0_0, τ_0_1, τ_0_2> (@in_guaranteed τ_0_0) -> (@out τ_0_2, @error_indirect τ_0_1) for <Array<Character>, Never, String>, @in_guaranteed LeavesWithCommonPrefixIterator<Character>) -> (@owned Array<String>, @error Never) {
[%0: noescape **, read v**.c*.v**, write v**.c*.v**, copy v**.c*.v**, destroy v**.c*.v**]
[%1: read v**, copy v**]
[global: read,write,copy,destroy,allocate,deinit_barrier]
// %0                                             // user: %144
// %1                                             // user: %11
bb0(%0 : @guaranteed $@noescape @callee_guaranteed @substituted <τ_0_0, τ_0_1, τ_0_2> (@in_guaranteed τ_0_0) -> (@out τ_0_2, @error_indirect τ_0_1) for <Array<Character>, Never, String>, %1 : $*LeavesWithCommonPrefixIterator<Character>):
  %2 = integer_literal $Builtin.Int64, 0          // users: %82, %3
  %3 = struct $Int (%2)                           // user: %9
  %4 = alloc_stack [var_decl] $ContiguousArray<String> // users: %187, %181, %179, %177, %165, %164, %9, %157, %149, %193, %7
  // function_ref specialized ContiguousArray.init()
  %5 = function_ref @$ss15ContiguousArrayVAByxGycfCSS_Ttg5 : $@convention(thin) () -> @owned ContiguousArray<String> // user: %6
  %6 = apply %5() : $@convention(thin) () -> @owned ContiguousArray<String> // user: %7
  store %6 to [init] %4                           // id: %7
  // function_ref specialized ContiguousArray.reserveCapacity(_:)
  %8 = function_ref @$ss15ContiguousArrayV15reserveCapacityyySiFSS_Tg5 : $@convention(method) (Int, @inout ContiguousArray<String>) -> () // user: %9
  %9 = apply %8(%3, %4) : $@convention(method) (Int, @inout ContiguousArray<String>) -> ()
  %10 = alloc_stack [var_decl] $LeavesWithCommonPrefixIterator<Character> // users: %63, %41, %22, %15, %14, %12, %186, %147, %11, %156, %192
  copy_addr %1 to [init] %10                      // id: %11
  debug_value %10, var, name "self", argno 1, expr op_deref // id: %12
  // function_ref specialized LeavesWithCommonPrefixIterator.iterator.getter
  %13 = function_ref @$s10Tokenizers30LeavesWithCommonPrefixIteratorV8iteratorSt_px7ElementRts_XPvgSJ_Tg5 : $@convention(method) (@inout LeavesWithCommonPrefixIterator<Character>) -> @out any IteratorProtocol<Character> // user: %22
  debug_value %10, var, name "self", argno 2, expr op_deref // id: %14
  %15 = struct_element_addr %10, #LeavesWithCommonPrefixIterator.$__lazy_storage_$_iterator // users: %29, %27, %16
  %16 = init_enum_data_addr %15, #Optional.some!enumelt // user: %28
  br bb1                                          // id: %17

bb1:                                              // Preds: bb15 bb0
  %18 = alloc_stack [var_decl] $Array<Character>  // users: %160, %185, %141, %144, %148, %191, %183
  br bb2                                          // id: %19

bb2:                                              // Preds: bb12 bb1
  %20 = alloc_stack $Optional<Character>          // users: %85, %86, %39, %35, %31, %25
  %21 = alloc_stack [lexical] $any IteratorProtocol<Character> // users: %30, %28, %26, %23, %22
  %22 = apply %13(%21, %10) : $@convention(method) (@inout LeavesWithCommonPrefixIterator<Character>) -> @out any IteratorProtocol<Character>
  %23 = open_existential_addr mutable_access %21 to $*@opened("66FAE1B4-CC30-11F0-9982-D62AEADCB800", any IteratorProtocol<Character>) Self // users: %25, %25, %24
  %24 = witness_method $@opened("66FAE1B4-CC30-11F0-9982-D62AEADCB800", any IteratorProtocol<Character>) Self, #IteratorProtocol.next : <Self where Self : IteratorProtocol> (inout Self) -> () -> Self.Element?, %23 : $*@opened("66FAE1B4-CC30-11F0-9982-D62AEADCB800", any IteratorProtocol<Character>) Self : $@convention(witness_method: IteratorProtocol) <τ_0_0 where τ_0_0 : IteratorProtocol> (@inout τ_0_0) -> @out Optional<τ_0_0.Element> // type-defs: %23; user: %25
  %25 = apply %24<@opened("66FAE1B4-CC30-11F0-9982-D62AEADCB800", any IteratorProtocol<Character>) Self>(%20, %23) : $@convention(witness_method: IteratorProtocol) <τ_0_0 where τ_0_0 : IteratorProtocol> (@inout τ_0_0) -> @out Optional<τ_0_0.Element> // type-defs: %23
  debug_value %21, let, name "value", argno 1, expr op_deref // id: %26
  destroy_addr %15                                // id: %27
  copy_addr [take] %21 to [init] %16              // id: %28
  inject_enum_addr %15, #Optional.some!enumelt    // id: %29
  dealloc_stack %21                               // id: %30
  %31 = load_borrow %20                           // users: %32, %84, %34
  switch_enum %31, case #Optional.some!enumelt: bb3, case #Optional.none!enumelt: bb4 // id: %32

bb3(%33 : @guaranteed $Character):                // Preds: bb2
  end_borrow %31                                  // id: %34
  %35 = load [take] %20                           // user: %36
  %36 = unchecked_enum_data %35, #Optional.some!enumelt // users: %38, %37
  debug_value %36, let, name "item"               // id: %37
  %38 = move_value [lexical] %36                  // users: %132, %113, %94, %91, %40
  dealloc_stack %20                               // id: %39
  %40 = copy_value %38                            // user: %60
  %41 = struct_element_addr %10, #LeavesWithCommonPrefixIterator.seq // users: %134, %62, %60, %58, %44, %43
  // function_ref specialized Array._makeUniqueAndReserveCapacityIfNotUnique()
  %42 = function_ref @$sSa034_makeUniqueAndReserveCapacityIfNotB0yyFSJ_Tg5 : $@convention(method) (@inout Array<Character>) -> () // user: %43
  %43 = apply %42(%41) : $@convention(method) (@inout Array<Character>) -> ()
  %44 = struct_element_addr %41, #Array._buffer   // user: %45
  %45 = struct_element_addr %44, #_ArrayBuffer._storage // user: %46
  %46 = struct_element_addr %45, #_BridgeStorage.rawValue // user: %47
  %47 = load_borrow %46                           // users: %56, %48
  %48 = unchecked_ref_cast %47 to $__ContiguousArrayStorageBase // user: %49
  %49 = ref_element_addr %48, #__ContiguousArrayStorageBase.countAndCapacity // user: %50
  %50 = struct_element_addr %49, #_ArrayBody._storage // user: %51
  %51 = struct_element_addr %50, #_SwiftArrayBodyStorage.count // user: %52
  %52 = struct_element_addr %51, #Int._value      // user: %53
  %53 = load [trivial] %52                        // user: %54
  %54 = builtin "assumeNonNegative_Int64"(%53) : $Builtin.Int64 // user: %55
  %55 = struct $Int (%54)                         // users: %60, %58
  end_borrow %47                                  // id: %56
  // function_ref specialized Array._reserveCapacityAssumingUniqueBuffer(oldCount:)
  %57 = function_ref @$sSa36_reserveCapacityAssumingUniqueBuffer8oldCountySi_tFSJ_Tg5 : $@convention(method) (Int, @inout Array<Character>) -> () // user: %58
  %58 = apply %57(%55, %41) : $@convention(method) (Int, @inout Array<Character>) -> ()
  // function_ref specialized Array._appendElementAssumeUniqueAndCapacity(_:newElement:)
  %59 = function_ref @$sSa37_appendElementAssumeUniqueAndCapacity_03newB0ySi_xntFSJ_Tg5 : $@convention(method) (Int, @owned Character, @inout Array<Character>) -> () // user: %60
  %60 = apply %59(%55, %40, %41) : $@convention(method) (Int, @owned Character, @inout Array<Character>) -> ()
  // function_ref specialized Array._endMutation()
  %61 = function_ref @$sSa12_endMutationyyFSJ_Tg5 : $@convention(method) (@inout Array<Character>) -> () // user: %62
  %62 = apply %61(%41) : $@convention(method) (@inout Array<Character>) -> ()
  %63 = struct_element_addr %10, #LeavesWithCommonPrefixIterator.node // users: %120, %119, %64
  %64 = load_borrow %63                           // users: %74, %65
  %65 = begin_borrow [lexical] %64                // users: %73, %66
  %66 = ref_element_addr %65, #TrieNode.children  // user: %67
  %67 = begin_access [read] [dynamic] [no_nested_conflict] %66 // users: %72, %68
  %68 = struct_element_addr %67, #Dictionary._variant // user: %69
  %69 = struct_element_addr %68, #Dictionary._Variant.object // user: %70
  %70 = struct_element_addr %69, #_BridgeStorage.rawValue // user: %71
  %71 = load [copy] %70                           // users: %131, %116, %90, %75
  end_access %67                                  // id: %72
  end_borrow %65                                  // id: %73
  end_borrow %64                                  // id: %74
  %75 = begin_borrow %71                          // users: %130, %115, %89, %76
  %76 = unchecked_ref_cast %75 to $__RawDictionaryStorage // users: %104, %94, %78, %77
  %77 = struct $_NativeDictionary<Character, TrieNode<Character>> (%76) // user: %114
  %78 = ref_element_addr %76, #__RawDictionaryStorage._count // user: %79
  %79 = struct_element_addr %78, #Int._value      // user: %80
  %80 = load [trivial] %79                        // user: %81
  %81 = builtin "assumeNonNegative_Int64"(%80) : $Builtin.Int64 // user: %82
  %82 = builtin "cmp_eq_Int64"(%81, %2) : $Builtin.Int1 // user: %83
  cond_br %82, bb5, bb6                           // id: %83

bb4:                                              // Preds: bb2
  end_borrow %31                                  // id: %84
  destroy_addr %20                                // id: %85
  dealloc_stack %20                               // id: %86
  %87 = enum $Optional<Array<Character>>, #Optional.none!enumelt // user: %88
  br bb8(%87)                                     // id: %88

bb5:                                              // Preds: bb3
  end_borrow %75                                  // id: %89
  destroy_value %71                               // id: %90
  destroy_value %38                               // id: %91
  br bb7                                          // id: %92

bb6:                                              // Preds: bb3
  // function_ref specialized __RawDictionaryStorage.find<A>(_:)
  %93 = function_ref @$ss22__RawDictionaryStorageC4findys10_HashTableV6BucketV6bucket_Sb5foundtxSHRzlFSJ_Tg5 : $@convention(method) (@guaranteed Character, @guaranteed __RawDictionaryStorage) -> (_HashTable.Bucket, Bool) // user: %94
  %94 = apply %93(%38, %76) : $@convention(method) (@guaranteed Character, @guaranteed __RawDictionaryStorage) -> (_HashTable.Bucket, Bool) // users: %96, %95
  %95 = tuple_extract %94, 0                      // user: %107
  %96 = tuple_extract %94, 1                      // user: %97
  %97 = struct_extract %96, #Bool._value          // user: %98
  cond_br %97, bb9, bb10                          // id: %98

bb7:                                              // Preds: bb10 bb5
  %99 = enum $Optional<Array<Character>>, #Optional.none!enumelt // user: %100
  br bb8(%99)                                     // id: %100

// %101                                           // users: %146, %140, %102
bb8(%101 : @owned $Optional<Array<Character>>):   // Preds: bb4 bb11 bb7
  %102 = begin_borrow %101                        // users: %145, %103, %139
  switch_enum %102, case #Optional.some!enumelt: bb13, case #Optional.none!enumelt: bb14 // id: %103

bb9:                                              // Preds: bb6
  %104 = ref_element_addr %76, #__RawDictionaryStorage._rawValues // user: %105
  %105 = struct_element_addr %104, #UnsafeMutableRawPointer._rawValue // user: %106
  %106 = load [trivial] %105                      // user: %110
  %107 = struct_extract %95, #_HashTable.Bucket.offset // user: %108
  %108 = struct_extract %107, #Int._value         // user: %109
  %109 = builtin "truncOrBitCast_Int64_Word"(%108) : $Builtin.Word // user: %111
  %110 = pointer_to_address %106 to [strict] $*TrieNode<Character> // user: %111
  %111 = index_addr [stack_protection] %110, %109 // user: %112
  %112 = load [copy] %111                         // user: %117
  destroy_value %38                               // id: %113
  fix_lifetime %77                                // id: %114
  end_borrow %75                                  // id: %115
  destroy_value %71                               // id: %116
  %117 = move_value [lexical] [var_decl] %112     // users: %119, %118
  debug_value %117, let, name "child"             // id: %118
  store %117 to [assign] %63                      // id: %119
  %120 = load_borrow %63                          // users: %128, %121
  %121 = begin_borrow [lexical] %120              // users: %127, %122
  %122 = ref_element_addr %121, #TrieNode.isLeaf  // user: %123
  %123 = begin_access [read] [dynamic] [no_nested_conflict] %122 // users: %126, %124
  %124 = struct_element_addr %123, #Bool._value   // user: %125
  %125 = load [trivial] %124                      // user: %129
  end_access %123                                 // id: %126
  end_borrow %121                                 // id: %127
  end_borrow %120                                 // id: %128
  cond_br %125, bb11, bb12                        // id: %129

bb10:                                             // Preds: bb6
  end_borrow %75                                  // id: %130
  destroy_value %71                               // id: %131
  destroy_value %38                               // id: %132
  br bb7                                          // id: %133

bb11:                                             // Preds: bb9
  %134 = load [copy] %41                          // user: %135
  %135 = enum $Optional<Array<Character>>, #Optional.some!enumelt, %134 // user: %136
  br bb8(%135)                                    // id: %136

bb12:                                             // Preds: bb9
  br bb2                                          // id: %137

bb13(%138 : @guaranteed $Array<Character>):       // Preds: bb8
  end_borrow %102                                 // id: %139
  %140 = unchecked_enum_data %101, #Optional.some!enumelt // user: %141
  store %140 to [init] %18                        // id: %141
  %142 = alloc_stack $String                      // users: %162, %144, %190, %182
  %143 = alloc_stack $Never                       // users: %188, %144, %189, %161
  try_apply %0(%142, %143, %18) : $@noescape @callee_guaranteed @substituted <τ_0_0, τ_0_1, τ_0_2> (@in_guaranteed τ_0_0) -> (@out τ_0_2, @error_indirect τ_0_1) for <Array<Character>, Never, String>, normal bb15, error bb16 // id: %144

bb14:                                             // Preds: bb8
  end_borrow %102                                 // id: %145
  destroy_value %101                              // id: %146
  destroy_addr %10                                // id: %147
  dealloc_stack %18                               // id: %148
  %149 = load [take] %4                           // user: %150
  %150 = destructure_struct %149                  // user: %151
  %151 = destructure_struct %150                  // user: %152
  %152 = unchecked_ref_cast %151 to $Builtin.BridgeObject // user: %153
  %153 = struct $_BridgeStorage<__ContiguousArrayStorageBase> (%152) // user: %154
  %154 = struct $_ArrayBuffer<String> (%153)      // user: %155
  %155 = struct $Array<String> (%154)             // user: %158
  dealloc_stack %10                               // id: %156
  dealloc_stack %4                                // id: %157
  return %155                                     // id: %158

bb15(%159 : $()):                                 // Preds: bb13
  destroy_addr %18                                // id: %160
  dealloc_stack %143                              // id: %161
  %162 = load [take] %142                         // user: %179
  // function_ref specialized ContiguousArray._makeUniqueAndReserveCapacityIfNotUnique()
  %163 = function_ref @$ss15ContiguousArrayV034_makeUniqueAndReserveCapacityIfNotD0yyFSS_Tg5 : $@convention(method) (@inout ContiguousArray<String>) -> () // user: %164
  %164 = apply %163(%4) : $@convention(method) (@inout ContiguousArray<String>) -> ()
  %165 = struct_element_addr %4, #ContiguousArray._buffer // user: %166
  %166 = struct_element_addr %165, #_ContiguousArrayBuffer._storage // user: %167
  %167 = load_borrow %166                         // users: %175, %168
  %168 = ref_element_addr %167, #__ContiguousArrayStorageBase.countAndCapacity // user: %169
  %169 = struct_element_addr %168, #_ArrayBody._storage // user: %170
  %170 = struct_element_addr %169, #_SwiftArrayBodyStorage.count // user: %171
  %171 = struct_element_addr %170, #Int._value    // user: %172
  %172 = load [trivial] %171                      // user: %173
  %173 = builtin "assumeNonNegative_Int64"(%172) : $Builtin.Int64 // user: %174
  %174 = struct $Int (%173)                       // users: %179, %177
  end_borrow %167                                 // id: %175
  // function_ref specialized ContiguousArray._reserveCapacityAssumingUniqueBuffer(oldCount:)
  %176 = function_ref @$ss15ContiguousArrayV36_reserveCapacityAssumingUniqueBuffer8oldCountySi_tFSS_Tg5 : $@convention(method) (Int, @inout ContiguousArray<String>) -> () // user: %177
  %177 = apply %176(%174, %4) : $@convention(method) (Int, @inout ContiguousArray<String>) -> ()
  // function_ref specialized ContiguousArray._appendElementAssumeUniqueAndCapacity(_:newElement:)
  %178 = function_ref @$ss15ContiguousArrayV37_appendElementAssumeUniqueAndCapacity_03newD0ySi_xntFSS_Tg5 : $@convention(method) (Int, @owned String, @inout ContiguousArray<String>) -> () // user: %179
  %179 = apply %178(%174, %162, %4) : $@convention(method) (Int, @owned String, @inout ContiguousArray<String>) -> ()
  // function_ref specialized ContiguousArray._endMutation()
  %180 = function_ref @$ss15ContiguousArrayV12_endMutationyyFSS_Tg5 : $@convention(method) (@inout ContiguousArray<String>) -> () // user: %181
  %181 = apply %180(%4) : $@convention(method) (@inout ContiguousArray<String>) -> ()
  dealloc_stack %142                              // id: %182
  dealloc_stack %18                               // id: %183
  br bb1                                          // id: %184

bb16:                                             // Preds: bb13
  destroy_addr %18                                // id: %185
  destroy_addr %10                                // id: %186
  destroy_addr %4                                 // id: %187
  %188 = load [trivial] %143                      // user: %194
  dealloc_stack %143                              // id: %189
  dealloc_stack %142                              // id: %190
  dealloc_stack %18                               // id: %191
  dealloc_stack %10                               // id: %192
  dealloc_stack %4                                // id: %193
  throw %188                                      // id: %194
} // end sil function '$sSTsE3mapySayqd__Gqd__7ElementQzqd_0_YKXEqd_0_YKs5ErrorRd_0_r0_lF10Tokenizers30LeavesWithCommonPrefixIteratorVySJG_SSs5NeverOTg5'

Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.	Program arguments: ……
1.	Apple Swift version 6.2.1 (swift-6.2.1-RELEASE)
2.	Compiling with effective version 5.10
3.	While evaluating request ExecuteSILPipelineRequest(Run pipelines { PrepareOptimizationPasses, EarlyModulePasses, HighLevel,Function+EarlyLoopOpt, HighLevel,Module+StackPromote, MidLevel,Function, ClosureSpecialize, LowLevel,Function, LateLoopOpt, SIL Debug Info Generator } on SIL for Tokenizers)
4.	While running pass #246348 SILFunctionTransform "OwnershipModelEliminator" on SILFunction "@$sSTsE3mapySayqd__Gqd__7ElementQzqd_0_YKXEqd_0_YKs5ErrorRd_0_r0_lF10Tokenizers30LeavesWithCommonPrefixIteratorVySJG_SSs5NeverOTg5".
 for 'map(_:)' (in module 'Swift')
5.	Found verification error when verifying before lowering ownership. Please re-run with -sil-verify-all to identify the actual pass that introduced the verification error.
6.	While verifying SIL function "@$sSTsE3mapySayqd__Gqd__7ElementQzqd_0_YKXEqd_0_YKs5ErrorRd_0_r0_lF10Tokenizers30LeavesWithCommonPrefixIteratorVySJG_SSs5NeverOTg5".
 for 'map(_:)' (in module 'Swift')
 #0 0x000000010866dab8 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x1058adab8)
 #1 0x000000010866bec8 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x1058abec8)
 #2 0x000000010866e104 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x1058ae104)
 #3 0x0000000199107744 (/usr/lib/system/libsystem_platform.dylib+0x1804e3744)
 #4 0x00000001990fd888 (/usr/lib/system/libsystem_pthread.dylib+0x1804d9888)
 #5 0x0000000199002850 (/usr/lib/system/libsystem_c.dylib+0x1803de850)
 #6 0x00000001086defa0 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x10591efa0)
 #7 0x0000000103e8dd78 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x1010cdd78)
 #8 0x0000000103e8d528 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x1010cd528)
 #9 0x0000000103e8d878 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x1010cd878)
#10 0x0000000103e8c5a0 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x1010cc5a0)
#11 0x0000000103e8ad9c (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x1010cad9c)
#12 0x0000000103e89fa8 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x1010c9fa8)
#13 0x0000000103e99544 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x1010d9544)
#14 0x0000000103e937ac (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x1010d37ac)
#15 0x0000000103996fe8 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x100bd6fe8)
#16 0x000000010399e8ec (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x100bde8ec)
#17 0x000000010399f5a8 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x100bdf5a8)
#18 0x000000010399c728 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x100bdc728)
#19 0x000000010399c6a8 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x100bdc6a8)
#20 0x00000001039b178c (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x100bf178c)
#21 0x00000001039a3b2c (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x100be3b2c)
#22 0x000000010399c918 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x100bdc918)
#23 0x00000001039a5120 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x100be5120)
#24 0x0000000103257558 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x100497558)
#25 0x0000000103021758 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x100261758)
#26 0x000000010302112c (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x10026112c)
#27 0x000000010302cfb8 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x10026cfb8)
#28 0x0000000103022b98 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x100262b98)
#29 0x00000001030223d0 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x1002623d0)
#30 0x0000000102df6420 (/Applications/Xcode.app/Contents/Developer/Toolchains/swift-LOCAL-2025-11-27-a.xctoolchain/usr/bin/swift-frontend+0x100036420)
#31 0x0000000198d35d54

Expected behavior

Build Archisuccessful like XcodeDefault toolchain.

Environment

Apple Swift version 6.2.1 (swift-6.2.1-RELEASE)
Target: arm64-apple-macosx26.0

Additional information

Using the demangle tool, parse the prototype corresponding to "@$sSTsE3mapySayqd__Gqd__7ElementQzqd_0_YKXEqd_0_YKs5ErrorRd_0_r0_lF10Tokenizers30LeavesWithCommonPrefixIteratorVySJG_SSs5NeverOTg5" as:
"@Generic specialization <Tokenizers.LeavesWithCommonPrefixIterator<Swift.Character>, Swift.String, Swift.Never> of (extension in Swift):Swift.Sequence.map<A, B where B1: Swift.Error>((A.Element) throws(B1) -> A1) throws(B1) -> [A1]"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.crashBug: A crash, i.e., an abnormal termination of softwaretriage neededThis issue needs more specific labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions