Hi! I had a package building correctly from Xcode_16_beta
and 6.0. I tried opening that package and building from production Xcode_15.4.0
and 5.10. I'm seeing these weird compiler crashes from PredictableMemoryAccessOptimizations
… but they go away after trying to rebuild. Cleaning derived data (and my build folders) starts the cycle over again… it fails and then it builds.
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 0x00000001088f3f3c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1 swift-frontend 0x00000001088f30f8 llvm::sys::RunSignalHandlers() + 112
2 swift-frontend 0x00000001088f4544 SignalHandler(int) + 360
3 libsystem_platform.dylib 0x0000000180f33584 _sigtramp + 56
4 swift-frontend 0x000000010407d038 (anonymous namespace)::SubstFunctionTypePatternVisitor::handleGenericNominalType(swift::Lowering::AbstractionPattern, swift::CanType)::'lambda'(swift::Type, swift::Type)::operator()(swift::Type, swift::Type) const + 152
5 swift-frontend 0x000000010407d038 (anonymous namespace)::SubstFunctionTypePatternVisitor::handleGenericNominalType(swift::Lowering::AbstractionPattern, swift::CanType)::'lambda'(swift::Type, swift::Type)::operator()(swift::Type, swift::Type) const + 152
6 swift-frontend 0x000000010407c820 (anonymous namespace)::SubstFunctionTypePatternVisitor::handleGenericNominalType(swift::Lowering::AbstractionPattern, swift::CanType) + 144
7 swift-frontend 0x000000010407b9b8 swift::CanTypeVisitor<(anonymous namespace)::SubstFunctionTypePatternVisitor, swift::CanType, swift::Lowering::AbstractionPattern>::visitStructType(swift::CanTypeWrapper<swift::StructType>, swift::Lowering::AbstractionPattern) + 288
8 swift-frontend 0x000000010407ae10 (anonymous namespace)::SubstFunctionTypePatternVisitor::visit(swift::CanType, swift::Lowering::AbstractionPattern) + 1588
9 swift-frontend 0x000000010407a6c8 (anonymous namespace)::SubstFunctionTypePatternVisitor::handleUnabstractedFunctionType(swift::CanTypeWrapper<swift::AnyFunctionType>, swift::Lowering::AbstractionPattern, swift::CanType, swift::Lowering::AbstractionPattern) + 208
10 swift-frontend 0x000000010407a234 swift::Lowering::AbstractionPattern::getSubstFunctionTypePattern(swift::CanTypeWrapper<swift::AnyFunctionType>, swift::Lowering::TypeConverter&, swift::Lowering::AbstractionPattern, swift::CanType, bool&) const + 236
11 swift-frontend 0x00000001040c2ad8 getSILFunctionType(swift::Lowering::TypeConverter&, swift::TypeExpansionContext, swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::AnyFunctionType>, swift::SILExtInfoBuilder, (anonymous namespace)::Conventions const&, swift::ForeignInfo const&, llvm::Optional<swift::SILDeclRef>, llvm::Optional<swift::SILDeclRef>, llvm::Optional<swift::SubstitutionMap>, swift::ProtocolConformanceRef) + 2008
12 swift-frontend 0x00000001040bacbc getNativeSILFunctionType(swift::Lowering::TypeConverter&, swift::TypeExpansionContext, swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::AnyFunctionType>, swift::SILExtInfoBuilder, llvm::Optional<swift::SILDeclRef>, llvm::Optional<swift::SILDeclRef>, llvm::Optional<swift::SubstitutionMap>, swift::ProtocolConformanceRef) + 2004
13 swift-frontend 0x0000000104161c78 swift::Lowering::TypeConverter::computeLoweredRValueType(swift::TypeExpansionContext, swift::Lowering::AbstractionPattern, swift::CanType)::LoweredRValueTypeVisitor::visitAnyFunctionType(swift::CanTypeWrapper<swift::AnyFunctionType>) + 804
14 swift-frontend 0x0000000104151334 swift::Lowering::TypeConverter::getTypeLowering(swift::Lowering::AbstractionPattern, swift::Type, swift::TypeExpansionContext) + 556
15 swift-frontend 0x00000001041615d4 swift::Lowering::TypeConverter::computeLoweredRValueType(swift::TypeExpansionContext, swift::Lowering::AbstractionPattern, swift::CanType)::LoweredRValueTypeVisitor::visitType(swift::CanType) + 148
16 swift-frontend 0x0000000104151334 swift::Lowering::TypeConverter::getTypeLowering(swift::Lowering::AbstractionPattern, swift::Type, swift::TypeExpansionContext) + 556
17 swift-frontend 0x0000000104143e9c swift::SILType::getFieldType(swift::VarDecl*, swift::Lowering::TypeConverter&, swift::TypeExpansionContext) const + 532
18 swift-frontend 0x0000000103be52dc getNumSubElements(swift::SILType, swift::SILModule&, swift::TypeExpansionContext) + 732
19 swift-frontend 0x0000000103be52f8 getNumSubElements(swift::SILType, swift::SILModule&, swift::TypeExpansionContext) + 760
20 swift-frontend 0x0000000103be52f8 getNumSubElements(swift::SILType, swift::SILModule&, swift::TypeExpansionContext) + 760
21 swift-frontend 0x0000000103be2a28 (anonymous namespace)::AllocOptimize::AllocOptimize(swift::AllocationInst*, llvm::SmallVectorImpl<swift::PMOMemoryUse>&, llvm::SmallVectorImpl<swift::SILInstruction*>&, swift::DeadEndBlocks&, swift::InstructionDeleter&) + 168
22 swift-frontend 0x0000000103be1ba0 swift::optimizeMemoryAccesses(swift::SILFunction*) + 620
23 swift-frontend 0x0000000103bf1b88 (anonymous namespace)::PredictableMemoryAccessOptimizations::run() + 24
24 swift-frontend 0x0000000103c2fa68 swift::SILPassManager::runFunctionPasses(unsigned int, unsigned int) + 3856
25 swift-frontend 0x0000000103c2c384 swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 14952
26 swift-frontend 0x0000000103c65354 swift::SimpleRequest<swift::ExecuteSILPipelineRequest, std::__1::tuple<> (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::evaluateRequest(swift::ExecuteSILPipelineRequest const&, swift::Evaluator&) + 56
27 swift-frontend 0x0000000103c49184 llvm::Expected<swift::ExecuteSILPipelineRequest::OutputType> swift::Evaluator::getResultUncached<swift::ExecuteSILPipelineRequest>(swift::ExecuteSILPipelineRequest const&) + 476
28 swift-frontend 0x0000000103c4b974 swift::runSILDiagnosticPasses(swift::SILModule&) + 412
29 swift-frontend 0x0000000103400cf8 swift::CompilerInstance::performSILProcessing(swift::SILModule*) + 84
30 swift-frontend 0x00000001031f1f98 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*) + 1128
31 swift-frontend 0x00000001031f1444 swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 608
32 swift-frontend 0x00000001031f5694 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 1448
33 swift-frontend 0x00000001031f36d0 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 4968
34 swift-frontend 0x0000000103182e8c swift::mainEntry(int, char const**) + 2612
35 dyld 0x0000000180b7a0e0 start + 2360
I also tried building the package from the 5.10 command line (swift build
) and I see a similar pattern (failing and then building).
This package depends on two local packages that build successfully with no problems. This package also depends on SwiftUI (it's a collection of view components).
I don't yet have any solid test cases to crash with probability one… I can keep investigating… but it seems (for now) to be non-deterministic. Any ideas about what else I could do to narrow down what could be breaking this on 5.10? Thanks!