Hi all,
I'd like to surface a crash we hit after upgrading our app's build toolchain to Xcode 26.3 (Swift 6.2). Sharing in case others run into it, and to ask whether this is an expected back-deployment limitation or something the runtime should handle more gracefully or there is something I am missing ?
Environment
- Xcode: 26.3 (Swift 6.2)
- Deployment target: iOS 16
- Crashing OS: iOS 17.x (simulator and device, all variants)
- Working OS: iOS 18+
- Affected upcoming feature:
NonisolatedNonsendingByDefault(SE-0461)
Symptom
The app launches fine but crashes the moment SwiftUI tries to render certain screens whose view models contain async APIs. The crashing thread is always a com.apple.root.utility-qos queue, and the top of the stack is a null deref:
0 0x00000000 (memory read failed for 0x0)
1 type metadata accessor for nonisolated(nonsending) () MyApp.debug.dylib
2 swift_getTypeByMangledNodeImpl libswiftCore.dylib
3 swift_getTypeByMangledName libswiftCore.dylib
4 AG::swift::metadata::mangled_type_name_ref AttributeGraph
5 AG::swift::metadata_visitor::visit_field AttributeGraph
6 AG::swift::metadata::visit AttributeGraph
7 AG::LayoutDescriptor::make_layout AttributeGraph
8 AG::(anonymous namespace)::TypeDescriptorCache::fetch AttributeGraph
Diagnosis
The compiler emits a type-metadata accessor whose mangled name references nonisolated(nonsending). The iOS 17 Swift runtime has no demangling support for that production, so swift_getTypeByMangledName returns null. AttributeGraph then walks the null metadata while building the view's layout descriptor and crashes.
The trigger is the NonisolatedNonsendingByDefault upcoming feature being enabled â either explicitly via .enableUpcomingFeature("NonisolatedNonsendingByDefault") in a SwiftPM target, or implicitly via the Xcode build setting SWIFT_APPROACHABLE_CONCURRENCY = YES, which turns it on as part of the bundle.
Critically, the metadata is emitted even for code that doesn't write nonisolated(nonsending) explicitly â any nonisolated async function in the module, plus inferred types in SwiftUI view bodies, ends up referencing the new mangled production. So a single SwiftPM dependency compiled with the feature on poisons every screen whose view tree includes its types.
Fix
Disable the feature for any module that gets linked into a binary running on iOS 17:
// Package.swift
swiftSettings: [
// .enableUpcomingFeature("NonisolatedNonsendingByDefault"), // â remove
]
// Xcode build settings
SWIFT_APPROACHABLE_CONCURRENCY = NO
SWIFT_UPCOMING_FEATURE_NONISOLATED_NONSENDING_BY_DEFAULT = NO
Questions
- Is this the intended back-deployment story for
NonisolatedNonsendingByDefault, i.e. it requires the iOS 18 Swift runtime and developers must gate it on deployment target? If so, it would be very helpful to surface this in the feature's release notes â currently nothing in the Xcode "Approachable Concurrency" UI hints that flipping it on will brick the app on iOS 17. - Is there a Swift runtime back-deployment shim planned that would let the feature target older OSes?
- Or there is something I am missing I should do when adapting swift 6
Curious whether others have hit this. I could appreciate if anyone can help.
Thanks!