Hi Folks,
I'm experiencing a compiler crash on a large project, which occurs only when archiving my target (not in debug builds). I'm looking for some guidance as to how I can further debug the cause of the crash.
I was hopeful that the issues mentioned in the Xcode 11.5 release notes might have been the cause, but it reproduces in 11.5 as well. Xcode 11.3 does not seem to reproduce the issue.
At the moment, when the compiler segfaults, it gives me the following stack trace:
While running pass #2022759 SILModuleTransform "PerformanceSILLinker".
0 swift 0x00000001115674ea PrintStackTraceSignalHandler(void*) + 42
1 swift 0x0000000111566cc0 SignalHandler(int) + 352
2 libsystem_platform.dylib 0x00007fff6a7dd5fd _sigtramp + 29
3 libsystem_platform.dylib 000000000000000000 _sigtramp + 2508335648
4 swift 0x000000010dbff165 swift::SILLinkerVisitor::visitProtocolConformance(swift::ProtocolConformanceRef, llvm::Optionalswift::SILDeclRef const&) + 197
5 swift 0x000000010dbfeac9 swift::SILLinkerVisitor::processFunction(swift::SILFunction*) + 825
6 swift 0x000000010dad1740 (anonymous namespace)::SILLinker::run() + 304
7 swift 0x000000010d9c2d09 swift::SILPassManager::execute() + 2329
8 swift 0x000000010d5c74c8 swift::CompilerInstance::performSILProcessing(swift::SILModule*, swift::UnifiedStatsReporter*) + 7912
9 swift 0x000000010d2c3070 performCompileStepsPostSILGen(swift::CompilerInstance&, swift::CompilerInvocation&, std::__1::unique_ptr<swift::SILModule, std::__1::default_deleteswift::SILModule >, bool, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, bool, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 1712
10 swift 0x000000010d2bab95 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 55813
11 swift 0x000000010d230b73 main + 1283
12 libdyld.dylib 0x00007fff6a5e4cc9 start + 1
I have tried using alternate toolchains, ex. Swift 5.2.4 Release 2020-05-18 (a), to get more debugging info, but they seem to turn up a number of compilation failures that I don't experience for the toolchain as it ships in Xcode 11.5. For instance, one of the watchOS targets fails with "unsupported target architecture: 'arm64_32'", and after removing that target, I get a number of failures in ObjC block syntax ("Incompatible block pointer types..."). Not sure how the open source toolchain would differ in these cases.
Thanks for any help!
Jared