With Swift 6.3 in Xcode 26.4, a combination of typed throws and a conditional catch can crash the Swift compiler with error: compile command failed due to signal 11. This is not a normal source-level diagnostic: swift-frontend terminates while processing SIL. The regression is especially relevant when code that compiled with Swift 6.2 suddenly fails after moving to Xcode 26.4.
Representative compiler output
error: compile command failed due to signal 11
Please submit a bug report and include the crash backtrace.
Stack dump:
...
While running pass SILFunctionTransform "ClosureLifetimeFixup"
...
swift::StackNesting::fixNesting(swift::SILFunction*)
Unlike an ordinary type-checking error, this output continues with a swift-frontend backtrace. The official reproducer fails in the SIL ClosureLifetimeFixup pass.
Cause
Swift issue #88220 documents this as a Swift 6.3 compiler regression. A typed-throwing function is called inside do; one error case is handled by a catch containing a where condition; unmatched errors are expected to propagate implicitly. Under that code shape, the SIL closure-lifetime repair pass reaches an invalid state and the compiler exits with SIGSEGV, reported as signal 11.
enum APIError: Error {
case duplicateItem
}
func execute() throws(APIError) {
// Work
}
func store(replaceDuplicates: Bool) throws {
do {
try execute()
} catch APIError.duplicateItem where replaceDuplicates {
// Handle only this condition
}
}
The same minimal pattern compiled with Swift 6.2.x according to the official report. The failure occurs during compilation, not while the application is running.
Affected version and conditions
- The issue was reproduced with Apple Swift 6.3 shipped in Xcode 26.4.
- The called function uses typed throws, such as
throws(APIError). - The caller uses a conditional clause such as
catch APIError.duplicateItem where condition. - Errors that do not satisfy that clause are left to propagate outward implicitly.
- The official minimal example compiled with Swift 6.2.x/Xcode 26.3, making this a 6.3 regression.
Fixed version:the official issue is closed, but its public page does not identify a fixing pull request or release milestone. It is therefore not safe to claim a specific Xcode version as the confirmed fix. Retest the minimal example whenever you update Xcode.
Recommended workarounds
1. Add an explicit rethrowing catch
In the official reproducer, adding a general catch after the conditional clause avoids the compiler crash. It preserves the intended behavior by explicitly forwarding every unmatched error.
func store(replaceDuplicates: Bool) throws {
do {
try execute()
} catch APIError.duplicateItem where replaceDuplicates {
// Handle the duplicate
} catch {
throw error
}
}
This does not swallow an error. It makes the control-flow edge explicit in a form Swift 6.3 can compile.
2. Move the where condition into the catch body
Another local workaround is to avoid the conditional catch and perform the condition check inside the matching catch. Always rethrow when the condition is false.
do {
try execute()
} catch APIError.duplicateItem {
if replaceDuplicates {
// Handle the duplicate
} else {
throw APIError.duplicateItem
}
}
3. Temporarily use the earlier toolchain
If source changes are temporarily impractical and your SDK requirements permit it, Xcode 26.3 with Swift 6.2.x can be used while the project is validated. Treat this as a temporary measure: current SDK or App Store submission requirements may prevent use of the older Xcode.
How to verify the workaround
- Record the active versions with
xcodebuild -versionandxcrun swift --version. - Check whether the stack dump contains
ClosureLifetimeFixuporStackNesting::fixNesting. - Add the explicit
catch { throw error }and rebuild the same scheme and configuration. - Run an Archive or Release build as well as Debug.
- In CI, verify the selected image and any
DEVELOPER_DIRoverride.
xcodebuild -version
xcrun swift --version
xcodebuild -scheme YourScheme -configuration Release build
Cautions
- Signal 11 is a generic compiler-crash outcome. Not every occurrence is issue #88220; compare the SIL pass and source pattern.
- When rewriting the catch clauses, do not accidentally suppress errors that previously propagated to the caller.
- Deleting Derived Data cannot fix a compiler regression, although cleaning old artifacts is useful after switching toolchains.
- Document the workaround with the Swift issue number so it can be reevaluated after a future toolchain update.
Summary
If Xcode 26.4/Swift 6.3 reports compile command failed due to signal 11 for code combining typed throws with a where-qualified catch, Swift issue #88220 is a strong match. Add an explicit rethrowing catch or move the condition into the catch body. Because the public issue does not name a confirmed fixed release, verify the minimal reproducer and a Release build after every Xcode update.
