Crash|Xcode 14.2 (14C18)|Array Allocation (via map().reduce())

Hello,

I'm seeing a crash in production in my app. I'm wondering if I could get any help with this.

Issue: Crash when an array of objects is converted into a map via calls to .map() and .reduce(). Accessing a lazy var causes the map/reduce call, and results in this crash.

This code has been working for almost year, and started to fail in production since our update to Xcode 14.2.

OS versions vary from 15.7 to 16.4.x.

Stacktrace:

libswiftCore.dylib
swift_slowAlloc.cold.1
libswiftCore.dylib
swift_slowAlloc
libswiftCore.dylib
swift_allocObject

App
merged function signature specialization <Arg[2] = Dead> of generic specialization <__C.SecCertificateRef> of Swift._ContiguousArrayBuffer.init(_uninitializedCount: Swift.Int, minimumCapacity: Swift.Int) -> Swift._ContiguousArrayBuffer<A>

App
merged generic specialization <SDXServiceDelivery.TaskSpec> of Swift._ContiguousArrayBuffer._consumeAndCreateNew(bufferIsUnique: Swift.Bool, minimumCapacity: Swift.Int, growForAppend: Swift.Bool) -> Swift._ContiguousArrayBuffer<A>

App
merged generic specialization <SDXServiceDelivery.TaskSpec> of Swift.ContiguousArray._createNewBuffer(bufferIsUnique: Swift.Bool, minimumCapacity: Swift.Int, growForAppend: Swift.Bool) -> ()

App
function signature specialization <Arg[1] = Owned To Guaranteed> of function signature specialization <Arg[0] = [Closure Propagated : closure #1 (SDXServiceDelivery.TaskRequest) -> SDXServiceDelivery.TaskSpec in closure #1 () -> Swift.Dictionary<Foundation.UUID, SDXServiceDelivery.TaskSpec> in SDXServiceDelivery.TaskContinuation.taskSpecs.getter : Swift.Dictionary<Foundation.UUID, SDXServiceDelivery.TaskSpec>, Argument Types : [SDXServiceDelivery.TaskContinuation]> of generic specialization <[SDXServiceDelivery.TaskRequest], SDXServiceDelivery.TaskSpec> of (extension in Swift):Swift.Collection.map<A>((A.Element) throws -> A1) throws -> [A1] <compiler-generated>:0

App
closure #1 () -> [Foundation.UUID : SDXServiceDelivery.TaskSpec] in SDXServiceDelivery.TaskContinuation.taskSpecs.getter : [Foundation.UUID : SDXServiceDelivery.TaskSpec] <compiler-generated>:0

App
SDXServiceDelivery.TaskContinuation.taskSpecs.getter : [Foundation.UUID : SDXServiceDelivery.TaskSpec] TaskContinuation.swift:55

App
$s18SDXServiceDelivery16TaskContinuationC7execute4withSDy10Foundation4UUIDVs6ResultOySDySSypGSgs5Error_pGGAOSg_tYaFTY0_ TaskContinuation.swift:165

libswift_Concurrency.dylib

swift::runJobInEstablishedExecutorContext(swift::Job*)

libswift_Concurrency.dylib

swift_job_runImpl(swift::Job*, swift::ExecutorRef)

libdispatch.dylib

_dispatch_root_queue_drain

libdispatch.dylib

_dispatch_worker_thread2

libsystem_pthread.dylib

_pthread_wqthread

libsystem_pthread.dylib

start_wqthread


Crash|Xcode 14.2 (14C18)|Array Allocation (via map().reduce())
 
 
Q