swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.65k stars 10.38k forks source link

swift-frontend crashed during compilation #72047

Open guoweis-work opened 8 months ago

guoweis-work commented 8 months ago

Description

Trying to build https://github.com/terhechte/SourceKittenDaemon for MacPro (x86_64) and it crashes.

Reproduction

Here is the call stack

➜ SourceKittenDaemon git:(master) make mkdir -p .build/release swift build -c release --build-path .build Building for production... remark: Incremental compilation has been disabled: it is not compatible with whole module optimization error: compile command failed due to signal 6 (use -v to see invocation)

:0: error: fatal error encountered while reading from module 'Commandant'; please submit a bug report (https://swift.org/contributing/#reporting-bugs) Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace. Stack dump: 0. Program arguments: /Applications/Xcode_15.1.0_15C65.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c /Users/guoweis/git/SourceKittenDaemon/Sources/sourcekittend/StartCommand.swift /Users/guoweis/git/SourceKittenDaemon/Sources/sourcekittend/main.swift -emit-module-path /Users/guoweis/git/SourceKittenDaemon/.build/x86_64-apple-macosx/release/sourcekittend.build/sourcekittend.swiftmodule -emit-module-doc-path /Users/guoweis/git/SourceKittenDaemon/.build/x86_64-apple-macosx/release/sourcekittend.build/sourcekittend.swiftdoc -emit-module-source-info-path /Users/guoweis/git/SourceKittenDaemon/.build/x86_64-apple-macosx/release/sourcekittend.build/sourcekittend.swiftsourceinfo -emit-dependencies-path /Users/guoweis/git/SourceKittenDaemon/.build/x86_64-apple-macosx/release/sourcekittend.build/sourcekittend.d -emit-abi-descriptor-path /Users/guoweis/git/SourceKittenDaemon/.build/x86_64-apple-macosx/release/sourcekittend.build/sourcekittend.abi.json -target x86_64-apple-macosx10.13 -enable-objc-interop -sdk /Applications/Xcode_15.1.0_15C65.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -I /Users/guoweis/git/SourceKittenDaemon/.build/x86_64-apple-macosx/release -I /Applications/Xcode_15.1.0_15C65.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -F /Applications/Xcode_15.1.0_15C65.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -color-diagnostics -g -module-cache-path /Users/guoweis/git/SourceKittenDaemon/.build/x86_64-apple-macosx/release/ModuleCache -swift-version 4.2 -O -D SWIFT_PACKAGE -new-driver-path /Applications/Xcode_15.1.0_15C65.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-driver -empty-abi-descriptor -resource-dir /Applications/Xcode_15.1.0_15C65.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -Xcc -fmodule-map-file=/Users/guoweis/git/SourceKittenDaemon/.build/x86_64-apple-macosx/release/CYaml.build/module.modulemap -Xcc -I -Xcc /Users/guoweis/git/SourceKittenDaemon/.build/checkouts/Yams/Sources/CYaml/include -Xcc -fmodule-map-file=/Users/guoweis/git/SourceKittenDaemon/.build/x86_64-apple-macosx/release/SourceKit.build/module.modulemap -Xcc -I -Xcc /Users/guoweis/git/SourceKittenDaemon/.build/checkouts/SourceKitten/Source/SourceKit/include -Xcc -fmodule-map-file=/Users/guoweis/git/SourceKittenDaemon/.build/x86_64-apple-macosx/release/Clang_C.build/module.modulemap -Xcc -I -Xcc /Users/guoweis/git/SourceKittenDaemon/.build/checkouts/SourceKitten/Source/Clang_C/include -Xcc -isysroot -Xcc /Applications/Xcode_15.1.0_15C65.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -Xcc -F -Xcc /Applications/Xcode_15.1.0_15C65.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -Xcc -fPIC -module-name sourcekittend -disable-clang-spi -target-sdk-version 14.2 -target-sdk-name macosx14.2 -external-plugin-path /Applications/Xcode_15.1.0_15C65.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/lib/swift/host/plugins#/Applications/Xcode_15.1.0_15C65.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode_15.1.0_15C65.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/local/lib/swift/host/plugins#/Applications/Xcode_15.1.0_15C65.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode_15.1.0_15C65.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode_15.1.0_15C65.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode_15.1.0_15C65.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode_15.1.0_15C65.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -plugin-path /Applications/Xcode_15.1.0_15C65.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode_15.1.0_15C65.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -enable-default-cmo -num-threads 32 -o /Users/guoweis/git/SourceKittenDaemon/.build/x86_64-apple-macosx/release/sourcekittend.build/StartCommand.swift.o -o /Users/guoweis/git/SourceKittenDaemon/.build/x86_64-apple-macosx/release/sourcekittend.build/main.swift.o 1. Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5) 2. Compiling with effective version 4.2 3. While evaluating request ExecuteSILPipelineRequest(Run pipelines { PrepareOptimizationPasses, EarlyModulePasses, HighLevel,Function+EarlyLoopOpt, HighLevel,Module+StackPromote, MidLevel,Function, ClosureSpecialize, LowLevel,Function, LateLoopOpt, SIL Debug Info Generator } on SIL for sourcekittend) 4. While running pass #322 SILModuleTransform "PerformanceSILLinker". 5. While deserializing SIL function "$s10Commandant3lmgoiys6ResultOyq_AA0A5ErrorOyq0_GGq_xXE_ADyxAGGtr1_lF" 6. *** DESERIALIZATION FAILURE *** *** If any module named here was modified in the SDK, please delete the *** *** new swiftmodule files from the SDK and keep only swiftinterfaces. *** module 'Commandant', builder version '5.9.2(5.9.2)/Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)', built from source, non-resilient, loaded from '/Users/guoweis/git/SourceKittenDaemon/.build/x86_64-apple-macosx/release/Commandant.swiftmodule' multiple matching base values (map) Cross-reference to module 'Swift' ... Result ... map ... with type <τ_0_0, τ_0_1, τ_1_0 where τ_0_1 : Error> (Result<τ_0_0, τ_0_1>) -> ((τ_0_0) -> τ_1_0) -> Result<τ_1_0, τ_0_1> 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 0x000000010e75d468 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 40 1 swift-frontend 0x0000000110030a08 llvm::sys::RunSignalHandlers() + 248 2 swift-frontend 0x000000011000441e SignalHandler(int) + 270 3 libsystem_platform.dylib 0x00007ff8042f837d _sigtramp + 29 4 libsystem_platform.dylib 0x00007ff7b30f6700 _sigtramp + 18446744072348492704 5 libsystem_c.dylib 0x00007ff8041e8a49 abort + 126 6 swift-frontend 0x0000000110c7698a swift::ModuleFileSharedCore::fatal(llvm::Error) const + 858 7 swift-frontend 0x0000000110ab240c swift::ModuleFile::diagnoseFatal(llvm::Error) const + 1196 8 swift-frontend 0x000000010eee2a93 swift::ModuleFile::fatal(llvm::Error) const + 51 9 swift-frontend 0x000000010eeefc1d swift::ModuleFile::getGenericSignatureChecked(llvm::PointerEmbeddedInt) + 1949 10 swift-frontend 0x000000010eeee86a swift::ModuleFile::getSubstitutionMapChecked(llvm::PointerEmbeddedInt) + 458 11 swift-frontend 0x0000000110ad45db swift::ModuleFile::getSubstitutionMap(llvm::PointerEmbeddedInt) + 27 12 swift-frontend 0x0000000110bdd34f swift::SILDeserializer::readSILInstruction(swift::SILFunction*, swift::SILBuilder&, unsigned int, llvm::SmallVectorImpl&) + 10463 13 swift-frontend 0x0000000110bce5ad swift::SILDeserializer::readSILFunctionChecked(llvm::PointerEmbeddedInt, swift::SILFunction*, llvm::StringRef, bool, bool) + 6301 14 swift-frontend 0x0000000110bfadfc swift::SILDeserializer::lookupSILFunction(swift::SILFunction*, bool) + 924 15 swift-frontend 0x000000010f0953a6 swift::SILLinkerVisitor::deserializeAndPushToWorklist(swift::SILFunction*) + 86 16 swift-frontend 0x000000010f09560b swift::SILLinkerVisitor::processFunction(swift::SILFunction*) + 251 17 swift-frontend 0x0000000110137dab (anonymous namespace)::SILLinker::run() (.llvm.16832261765263987972) + 155 18 swift-frontend 0x00000001126c3a5b swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 20267 19 swift-frontend 0x00000001129d6c7c swift::SimpleRequest (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::evaluateRequest(swift::ExecuteSILPipelineRequest const&, swift::Evaluator&) + 60 20 swift-frontend 0x000000010e4df469 llvm::Expected swift::Evaluator::getResultUncached(swift::ExecuteSILPipelineRequest const&) + 505 21 swift-frontend 0x000000010e4f3eab swift::runSILOptimizationPasses(swift::SILModule&) + 475 22 swift-frontend 0x000000010e658126 swift::CompilerInstance::performSILProcessing(swift::SILModule*) + 630 23 swift-frontend 0x00000001129129bf performCompileStepsPostSILGen(swift::CompilerInstance&, std::__1::unique_ptr>, llvm::PointerUnion, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 1007 24 swift-frontend 0x000000011290e418 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 7288 25 swift-frontend 0x0000000112911d1c swift::performFrontend(llvm::ArrayRef, char const*, void*, swift::FrontendObserver*) + 5532 26 swift-frontend 0x0000000112980533 swift::mainEntry(int, char const**) + 2035 27 dyld 0x00007ff803f3f386 start + 1942 make: *** [.build/release/sourcekittend] Error 1 ### Expected behavior shouldn't crash ### Environment swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5) Target: x86_64-apple-macosx14.0 ### Additional information _No response_
kevin3747118 commented 8 months ago

Same issue here.