[Needs Urgent Help!] Command SwiftCompile failed with a nonzero exit code

Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:

0.	Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c /Users/lawrey/Documents/GitHub/IPPTPLUS-IOS/IPPT/Common/Toast/Toast.swift /Users/lawrey/Documents/GitHub/IPPTPLUS-IOS/IPPT/Shop/CheckOutViewController.swift /Users/lawrey/Documents/GitHub/IPPTPLUS-IOS/IPPT/Common/UITextField/NLPaddedTextFieldView.swift
...
...
/IPPT.build/Release-iphoneos/IPPT.build/Objects-normal/arm64/SettingsVC.o -index-unit-output-path /IPPT.build/Release-iphoneos/IPPT.build/Objects-normal/arm64/DGElasticPullToRefreshConstants.o -index-unit-output-path /IPPT.build/Release-iphoneos/IPPT.build/Objects-normal/arm64/DGElasticPullToRefreshView.o -index-unit-output-path /IPPT.build/Release-iphoneos/IPPT.build/Objects-normal/arm64/CountDownRouterVC.o -index-unit-output-path /IPPT.build/Release-iphoneos/IPPT.build/Objects-normal/arm64/DatePickerTableViewCell.o -index-unit-output-path /IPPT.build/Release-iphoneos/IPPT.build/Objects-normal/arm64/CircularProgress.o

1.	Apple Swift version 5.8 (swiftlang-5.8.0.124.2 clang-1403.0.22.11.100)
2.	Compiling with the current language version
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 IPPT)
4.	While running pass #670343 SILModuleTransform "DeadFunctionAndGlobalElimination".
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           0x0000000109b7f300 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x0000000109b7e2e4 llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x0000000109b7f910 SignalHandler(int) + 344
3  libsystem_platform.dylib 0x000000019418aa24 _sigtramp + 56
4  swift-frontend           0x00000001052bb65c (anonymous namespace)::DeadFunctionAndGlobalEliminationPass::run() + 424
5  swift-frontend           0x00000001052bb65c (anonymous namespace)::DeadFunctionAndGlobalEliminationPass::run() + 424
6  swift-frontend           0x00000001054214a0 swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 15312
7  swift-frontend           0x0000000105442a04 swift::SimpleRequest<swift::ExecuteSILPipelineRequest, std::__1::tuple<> (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::evaluateRequest(swift::ExecuteSILPipelineRequest const&, swift::Evaluator&) + 56
8  swift-frontend           0x0000000105428dd4 llvm::Expected<swift::ExecuteSILPipelineRequest::OutputType> swift::Evaluator::getResultUncached<swift::ExecuteSILPipelineRequest>(swift::ExecuteSILPipelineRequest const&) + 484
9  swift-frontend           0x000000010542b714 swift::runSILOptimizationPasses(swift::SILModule&) + 400
10 swift-frontend           0x0000000104c09c10 swift::CompilerInstance::performSILProcessing(swift::SILModule*) + 524
11 swift-frontend           0x0000000104a6d51c 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*) + 1040
12 swift-frontend           0x0000000104a70ab8 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 3288
13 swift-frontend           0x0000000104a6e944 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 4308
14 swift-frontend           0x0000000104a3368c swift::mainEntry(int, char const**) + 4116
15 dyld                     0x0000000193e03f28 start + 2236
Command SwiftCompile failed with a nonzero exit code

I need help understanding the root cause to resolve. Overwhelmed by the log :(

Replies

This is the Swift compiler crashing. The compiler should never crash no matter what your code looks like, so this is by definition a bug.

A good first step here is to try to reproduce the problem on a ‘clean’ machine. This has a bunch of a benefits:

  • If you can’t reproduce it, you know that it’s tied to your environment in some way.

  • You can reproduce it, you’re somewhere towards be able to file an actionable bug report.

  • You can also use your reproduction steps to try out workarounds.

I usually use a VM for this sort of thing, but if you don’t have that set up you can create a new local user account and try it there.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

did you find a solution?

I also faced this issue since Xcode 14.3

  • Xcode 14.2 It works fine

Swift Optimization with -Onone is working. But -O is not working.

I also posted it https://github.com/apple/swift/issues/64859

/Users/yoshi/Library/Developer/Xcode/DerivedData/TT-galmzhtedumvzaewgvxgohgbvzou/Build/Intermediates.noindex/TT.build/App Store-iphonesimulator/TT.build/DerivedSources/GeneratedAssetSymbols.swift

  1. 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 NinetyNine)
  2. While running pass #16730432 SILModuleTransform "DeadFunctionAndGlobalElimination".

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 0x00000001077af14c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56 1 swift-frontend 0x000000010a32df2c llvm::sys::RunSignalHandlers() + 112 2 swift-frontend 0x000000010606f10c SignalHandler(int) + 352 3 libsystem_platform.dylib 0x000000018db61a24 _sigtramp + 56 4 swift-frontend 0x0000000108e4725c (anonymous namespace)::DeadFunctionAndGlobalEliminationPass::run() (.llvm.2696310751390425970) + 432 5 swift-frontend 0x0000000108e4725c (anonymous namespace)::DeadFunctionAndGlobalEliminationPass::run() (.llvm.2696310751390425970) + 432 6 swift-frontend 0x0000000109c8708c swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 16276 7 swift-frontend 0x0000000109e0af90 swift::SimpleRequest<swift::ExecuteSILPipelineRequest, std::__1::tuple<> (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::evaluateRequest(swift::ExecuteSILPipelineRequest const&, swift::Evaluator&) + 56 8 swift-frontend 0x0000000109cc07e4 llvm::Expected<swift::ExecuteSILPipelineRequest::OutputType> swift::Evaluator::getResultUncached<swift::ExecuteSILPipelineRequest>(swift::ExecuteSILPipelineRequest const&) + 476 9 swift-frontend 0x0000000109cdd074 swift::runSILOptimizationPasses(swift::SILModule&) + 472 10 swift-frontend 0x000000010578614c swift::CompilerInstance::performSILProcessing(swift::SILModule*) + 572 11 swift-frontend 0x0000000109bc3328 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*) + 956 12 swift-frontend 0x000000010a2e5e14 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 3020 13 swift-frontend 0x000000010a2e9474 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 4568 14 swift-frontend 0x0000000109c2f4e0 swift::mainEntry(int, char const**) + 4116 15 dyld 0x000000018d7b9058 start + 2224

Also experiencing this. I isolating the issue to some recent Firebase pod changes. In my case moving from 10.17.0 to 10.24.0 but haven't figured out anything further.