-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[6.0.1] Compiler crashes when attempting to compile Swift Foundation. Failed to reconstruct type. #76788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This was referenced Jan 20, 2025
Workaround if using swiftpm:
|
Simple reproducer: public extension Sequence {
func sumOf(_ selector: (Self.Element) -> CGFloat) -> CGFloat {
var result: CGFloat = 0
for elem in self {
result += selector(elem)
}
return result
}
} For some reason I can only reproduce it if I use swift via swiftly. Swift from Xcode doesn't crash Crashes with:
|
nikitabobko
added a commit
to nikitabobko/AeroSpace
that referenced
this issue
Apr 3, 2025
Now when I use swiftly, I managed to reproduce the crash locally swiftlang/swift#76788 Failed to reconstruct type for $s7ElementSTQz12CoreGraphics7CGFloatVIgnd_D Original type: (sil_function_type type="@NoEscape @callee_guaranteed (@in_guaranteed \xCF\x84_0_0.Element) -> CGFloat" (dependent_member_type assoc_type="Swift.(file).Sequence.Element" (base=generic_type_param_type depth=0 index=0 param_kind=type)) (struct_type decl="CoreFoundation.(file).CGFloat") (substitution_map null_generic_signature) (substitution_map null_generic_signature)) Generic signature: <τ_0_0 where τ_0_0 : Sequence> Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace. Pass '-Xfrontend -disable-round-trip-debug-types' to disable this assertion. Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace. Stack dump: 0. Program arguments: /Users/bobko/Library/Developer/Toolchains/swift-6.1-RELEASE.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Users/bobko/a/swift-sandbox/Sources/_main.swift -emit-dependencies-path _main.d -emit-reference-dependencies-path _main.swiftdeps -target arm64-apple-macosx13.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk -I /Users/bobko/a/swift-sandbox/.build/arm64-apple-macosx/debug/Modules -I /Users/bobko/Library/Developer/Toolchains/swift-6.1-RELEASE.xctoolchain/usr/lib/swift/macosx/testing -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/PrivateFrameworks -color-diagnostics -enable-testing -g -debug-info-format=dwarf -dwarf-version=4 -module-cache-path /Users/bobko/a/swift-sandbox/.build/arm64-apple-macosx/debug/ModuleCache -swift-version 6 -Onone -D SWIFT_PACKAGE -D DEBUG -entry-point-function-name swift_sandbox_main -empty-abi-descriptor -plugin-path /Users/bobko/Library/Developer/Toolchains/swift-6.1-RELEASE.xctoolchain/usr/lib/swift/host/plugins/testing -resource-dir /Users/bobko/Library/Developer/Toolchains/swift-6.1-RELEASE.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -file-compilation-dir /Users/bobko/a/swift-sandbox -Xcc -isysroot -Xcc /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk -Xcc -F -Xcc /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -Xcc -F -Xcc /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/PrivateFrameworks -Xcc -fPIC -Xcc -g -module-name swift_sandbox -package-name swift_sandbox -in-process-plugin-server-path /Users/bobko/Library/Developer/Toolchains/swift-6.1-RELEASE.xctoolchain/usr/lib/swift/host/libSwiftInProcPluginServer.dylib -plugin-path /Users/bobko/Library/Developer/Toolchains/swift-6.1-RELEASE.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Users/bobko/Library/Developer/Toolchains/swift-6.1-RELEASE.xctoolchain/usr/local/lib/swift/host/plugins -target-sdk-version 15.4 -target-sdk-name macosx15.4 -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -parse-as-library -o _main.o -index-store-path /Users/bobko/a/swift-sandbox/.build/arm64-apple-macosx/debug/index/store -index-system-modules 1. Apple Swift version 6.1 (swift-6.1-RELEASE) 2. Compiling with the current language version 3. While evaluating request IRGenRequest(IR Generation for file "/Users/bobko/a/swift-sandbox/Sources/_main.swift") 4. While emitting IR SIL function "@$sST13swift_sandboxE5sumOfy12CoreGraphics7CGFloatVAE7ElementQzXEF". for 'sumOf(_:)' (at /Users/bobko/a/swift-sandbox/Sources/_main.swift:14:5) Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it): 0 swift-frontend 0x00000001075db884 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56 1 swift-frontend 0x00000001075d9fb0 llvm::sys::RunSignalHandlers() + 112 2 swift-frontend 0x00000001075dbec8 SignalHandler(int) + 292 3 libsystem_platform.dylib 0x0000000186b0ade4 _sigtramp + 56 4 libsystem_pthread.dylib 0x0000000186ad3f70 pthread_kill + 288 5 libsystem_c.dylib 0x00000001869e0908 abort + 128 6 swift-frontend 0x000000010767e95c (anonymous namespace)::IRGenDebugInfoImpl::getOrCreateType(swift::irgen::DebugTypeInfo, llvm::DIScope*) (.cold.24) + 0 7 swift-frontend 0x000000010278c9c0 (anonymous namespace)::IRGenDebugInfoImpl::getOrCreateType(swift::irgen::DebugTypeInfo, llvm::DIScope*) + 4124 8 swift-frontend 0x000000010278cd18 (anonymous namespace)::IRGenDebugInfoImpl::createParameterTypes(swift::CanTypeWrapper<swift::SILFunctionType>) + 752 9 swift-frontend 0x0000000102786040 (anonymous namespace)::IRGenDebugInfoImpl::emitFunction(swift::SILDebugScope const*, llvm::Function*, swift::SILFunctionTypeRepresentation, swift::SILType, swift::DeclContext*, llvm::StringRef) + 1636 10 swift-frontend 0x00000001027c6adc (anonymous namespace)::IRGenSILFunction::emitSILFunction() + 1104 11 swift-frontend 0x00000001027c60ec swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 1812 12 swift-frontend 0x000000010266aca0 swift::irgen::IRGenerator::emitGlobalTopLevel(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&) + 728 13 swift-frontend 0x000000010277a5f8 swift::IRGenRequest::evaluate(swift::Evaluator&, swift::IRGenDescriptor) const + 2396 14 swift-frontend 0x00000001027c5608 swift::GeneratedModule swift::SimpleRequest<swift::IRGenRequest, swift::GeneratedModule (swift::IRGenDescriptor), (swift::RequestFlags)17>::callDerived<0ul>(swift::Evaluator&, std::__1::integer_sequence<unsigned long, 0ul>) const + 200 15 swift-frontend 0x0000000102781d90 swift::IRGenRequest::OutputType swift::Evaluator::getResultUncached<swift::IRGenRequest, swift::IRGenRequest::OutputType swift::evaluateOrFatal<swift::IRGenRequest>(swift::Evaluator&, swift::IRGenRequest)::'lambda'()>(swift::IRGenRequest const&, swift::IRGenRequest::OutputType swift::evaluateOrFatal<swift::IRGenRequest>(swift::Evaluator&, swift::IRGenRequest)::'lambda'()) + 212 16 swift-frontend 0x000000010277c434 swift::performIRGeneration(swift::FileUnit*, swift::IRGenOptions const&, swift::TBDGenOptions const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::GlobalVariable**) + 208 17 swift-frontend 0x00000001022f08dc generateIR(swift::IRGenOptions const&, swift::TBDGenOptions const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, llvm::GlobalVariable*&, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>) + 156 18 swift-frontend 0x00000001022ed5d4 performCompileStepsPostSILGen(swift::CompilerInstance&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 1372 19 swift-frontend 0x00000001022eca3c swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 468 20 swift-frontend 0x00000001022f8b50 withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) + 164 21 swift-frontend 0x00000001022ee74c performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 716 22 swift-frontend 0x00000001022edf68 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2228 23 swift-frontend 0x00000001020d18f0 swift::mainEntry(int, char const**) + 3064 24 dyld 0x0000000186754274 start + 2840
This seems to be fixed with swift 6.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When attempting to compile the latest branch of Swift Foundation (https://github.com/swiftlang/swift-foundation/) using the swift.org release of Swift 6.0.1 on MacOS, the compiler crashes.
Reproduction
main
pointed tob2d323e
)swift test
Stack dump
Expected behavior
The code builds without error
Environment
$ swift --version
Additional information
It's unclear if this is a regression from 6.0.0 since there was another issue causing this to be unable to be built in the previous version (#76534)
The text was updated successfully, but these errors were encountered: