Skip to content
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

[SR-15762] Segfault on conditional conformance + inlinable + release #58039

Open
stephencelis opened this issue Jan 21, 2022 · 0 comments
Open

[SR-15762] Segfault on conditional conformance + inlinable + release #58039

stephencelis opened this issue Jan 21, 2022 · 0 comments

Comments

@stephencelis
Copy link
Contributor

@stephencelis stephencelis commented Jan 21, 2022

Previous ID SR-15762
Radar None
Original Reporter @stephencelis
Type Bug

Attachment: Download

Environment

Swift 5.5

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 5ff3237eb79b66fd10ee4699e8ebf98f

Issue Description:

Check out the attached reduced project and build the "swift-parsing-benchmark" target for release. It will segfault with the following output:

1. Apple Swift version 5.5.2 (swiftlang-1300.0.47.5 clang-1300.0.29.30)
2.
3. While evaluating request ExecuteSILPipelineRequest(Run pipelines { PrepareOptimizationPasses, EarlyModulePasses, HighLevel,Function+EarlyLoopOpt, HighLevel,Module+StackPromote, Serialize, MidLevel,Function, ClosureSpecialize, LowLevel,Function, LateLoopOpt, SIL Debug Info Generator } on SIL for swift_parsing_benchmark.swift_parsing_benchmark)
4. While running pass #​86 SILFunctionTransform "GenericSpecializer" on SILFunction "@main".
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           0x00000001083f79c4 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x00000001083f6acc llvm::sys::RunSignalHandlers() + 128
2  swift-frontend           0x00000001083f8004 SignalHandler(int) + 292
3  libsystem_platform.dylib 0x00000001945284e4 _sigtramp + 56
4  swift-frontend           0x0000000105190198 swift::GenericSignatureImpl::getConformanceAccessPath(swift::Type, swift::ProtocolDecl*) const + 68
5  swift-frontend           0x0000000105190198 swift::GenericSignatureImpl::getConformanceAccessPath(swift::Type, swift::ProtocolDecl*) const + 68
6  swift-frontend           0x00000001051905c0 swift::GenericSignatureImpl::getConformanceAccessPath(swift::Type, swift::ProtocolDecl*) const + 1132
7  swift-frontend           0x0000000105230eac swift::SubstitutionMap::lookupConformance(swift::CanType, swift::ProtocolDecl*) const + 552
8  swift-frontend           0x0000000105220560 swift::ProtocolConformanceRef::subst(swift::Type, llvm::function_ref<swift::Type (swift::SubstitutableType*)>, llvm::function_ref<swift::ProtocolConformanceRef (swift::CanType, swift::Type, swift::ProtocolDecl*)>, swift::SubstOptions) const + 1088
9  swift-frontend           0x0000000104b3d474 swift::SILCloner<swift::GenericCloner>::getOpConformance(swift::Type, swift::ProtocolConformanceRef) + 248
10 swift-frontend           0x0000000104b3881c swift::SILInstructionVisitor<swift::GenericCloner, void>::visit(swift::SILInstruction*) + 27252
11 swift-frontend           0x0000000104b30c80 swift::GenericCloner::populateCloned() + 1308
12 swift-frontend           0x0000000104b450f8 swift::GenericFuncSpecializer::tryCreateSpecialization(bool) + 748
13 swift-frontend           0x0000000104b470a0 swift::trySpecializeApplyOfGeneric(swift::SILOptFunctionBuilder&, swift::ApplySite, llvm::SmallSetVector<swift::SILInstruction*, 8u>&, llvm::SmallVectorImpl<swift::SILFunction*>&, swift::OptRemark::Emitter&) + 3368
14 swift-frontend           0x0000000104a6c5e0 (anonymous namespace)::GenericSpecializer::run() + 932
15 swift-frontend           0x00000001049dee78 swift::SILPassManager::runFunctionPasses(unsigned int, unsigned int) + 3524
16 swift-frontend           0x00000001049db8cc swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 164
17 swift-frontend           0x00000001049f2fb4 swift::SimpleRequest<swift::ExecuteSILPipelineRequest, std::__1::tuple<> (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::evaluateRequest(swift::ExecuteSILPipelineRequest const&, swift::Evaluator&) + 56
18 swift-frontend           0x00000001049e2b00 llvm::Expected<swift::ExecuteSILPipelineRequest::OutputType> swift::Evaluator::getResultUncached<swift::ExecuteSILPipelineRequest>(swift::ExecuteSILPipelineRequest const&) + 476
19 swift-frontend           0x00000001049e49d4 swift::runSILOptimizationPasses(swift::SILModule&) + 352
20 swift-frontend           0x00000001042a7a48 swift::CompilerInstance::performSILProcessing(swift::SILModule*) + 1032
21 swift-frontend           0x0000000104175bb0 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*) + 1036
22 swift-frontend           0x0000000104169790 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7060
23 swift-frontend           0x00000001040c2df8 main + 932
24 dyld                     0x000000010a68d0f4 start + 520
error: Segmentation fault: 11 (in target 'swift-parsing-benchmark' from project 'swift-parsing')

Removing "@inlinable" from "Optionally.print" fixes things, as does simplifying the project further (removing the "Parser" protocol and just having "Printer").

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant