You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Release build crashes the compiler on Linux since #389 (RCodesign) #431
Since #389 (zsign replaced by RCodesign), a release build of XKit crashes the Swift compiler on Linux x86_64. Upstream CI builds debug only (build.yml), so it does not show there; the next tagged Linux release (release.yml) would hit it.
Reproduce (upstream's own image: the build-limd stage of the Dockerfile at ac40282, on swift:6.4.2-jammy)
git checkout ac40282
swift build -c release --target XKit
*** Program crashed: Bad pointer dereference at 0x… ***
Running pass "require<globals-aa>,function(invalidate<aa>),…" on module ".../XKit-t.build/Objects-normal/x86_64/DeveloperServicesAddAppGroupRequest.o"
error: Build failed
The crashing threads are in LLVM: Verifier::visitFunction, AttributeList::hasAttributeAtIndex, CodeGenPrepare::optimizeCallInst, KnownBits::getMaxValue. The other XKit objects of that batch then fail with error closing '….o' … No such file or directory.
Bisect (git bisect run between 1.24.0 (good) and ac40282 (bad), release build of the xtool product)
I narrowed it down: it is a Swift compiler bug, set off by the two unimplemented() calls that #389 added in UnimplementedSigner (Sources/XKit/Signer/Signer.swift).
In XKit (at 64fe8e3, release build of the XKit target)
It still crashes with:
RCodesignSigner.swift stubbed, or the RCodesign dependency removed altogether;
zsign / SignerSupport added back to the graph;
RCodesignSigner as a struct;
either @Dependency(\.signer) property replaced.
It builds with the pre-signer: replace zsign with RCodesign #389 XKit sources, or with only the UnimplementedSigner bodies changed. Either of the two calls alone is enough to crash:
These pick the overload unimplemented<each Argument, Result>(…) -> @Sendable (repeat each Argument) throws -> sending Result of swift-issue-reporting 2.1.2, with an empty pack, called from an async function. The other unimplemented() calls in XKit pick the async-closure overloads and are fine.
Minimal reproducer (no dependency, Swift 6.4.2, swift:6.4.2-jammy, x86_64)
// Lib.swift
publicfuncmake<each Argument>()->(repeat each Argument)->Void{{(argument:repeat each Argument)in}}
Activity
c4software commentedon Nov 6, 2026
I narrowed it down: it is a Swift compiler bug, set off by the two
unimplemented()calls that #389 added inUnimplementedSigner(Sources/XKit/Signer/Signer.swift).In XKit (at 64fe8e3, release build of the
XKittarget)RCodesignSigner.swiftstubbed, or theRCodesigndependency removed altogether;RCodesignSigneras a struct;@Dependency(\.signer)property replaced.UnimplementedSignerbodies changed. Either of the two calls alone is enough to crash:unimplemented<each Argument, Result>(…) -> @Sendable (repeat each Argument) throws -> sending Resultof swift-issue-reporting 2.1.2, with an empty pack, called from anasyncfunction. The otherunimplemented()calls in XKit pick the async-closure overloads and are fine.Minimal reproducer (no dependency, Swift 6.4.2,
swift:6.4.2-jammy, x86_64)-Ononebuilds.run()builds.-enable-library-evolutiononLibstill crashes.throwsandsendingdo not matter.Workaround in xtool (tested at ac40282:
swift build -c release --product xtoolthen builds):) async throws { - let operation: () throws -> Void = unimplemented() - try operation() + reportIssue("Unimplemented: Signer.sign") + throw UnimplementedFailure(description: "Signer.sign") } func analyze(executable: URL) async throws -> Data? { - let operation: () throws -> Data? = unimplemented() - return try operation() + reportIssue("Unimplemented: Signer.analyze") + throw UnimplementedFailure(description: "Signer.analyze") }signer: avoid unimplemented() in UnimplementedSigner
build: fix compiler crash in release due to `unimplemented()` (xtool-…