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

[Source compatibility suite] Doggie causing compiler assertion failure - Assertion failed: ((sig && sig->isEqual(subs.getGenericSignature())) || !OrigType || !OrigType->hasTypeParameter()) #65200

Closed
justice-adams-apple opened this issue Apr 14, 2023 · 3 comments · Fixed by #65177 or #65190
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself crash Bug: A crash, i.e., an abnormal termination of software generics Feature: generic declarations and types SILGen Area → compiler: The SIL generation stage source compatibility suite Flag: An issue that surfaced in the source compatibility suite swift 5.9

Comments

@justice-adams-apple
Copy link
Contributor

Doggie is failing to build on main and 5.9 with the following compiler crash:

Assertion failed: ((sig && sig->isEqual(subs.getGenericSignature())) || !OrigType || !OrigType->hasTypeParameter()), function withSubstitutions, file AbstractionPattern.h, line 1099.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.	Program arguments: swift-main-source-compat-suite/build/compat_macos/install/toolchain/usr/bin/swift-frontend -frontend -c <ARGS OMITTED>
1.	Apple Swift version 5.9-dev (LLVM 0b945a41db5d9af, Swift 56ac0f0c0d010c5)
2.	Compiling with the current language version
3.	While evaluating request ASTLoweringRequest(Lowering AST to SIL for module DoggieCore)
4.	While silgen emitFunction SIL function "@$s10DoggieCore12MappedBufferV6append10contentsOfyqd___t7ElementQyd__RszSTRd__lF".
 for 'append(contentsOf:)' (at swift-source-compat-suite/project_cache/Doggie/Sources/DoggieCore/Foundation/MappedBuffer.swift:270:21)
5.	While silgen emitFunction SIL function "@$s10DoggieCore12MappedBufferV6append10contentsOfyqd___t7ElementQyd__RszSTRd__lF01_E0L_yyqd0__AGRszSTRd__STRd0__AFQyd0__AGRSr___lF".
 for '_append(_:)' (at swift-source-compat-suite/project_cache/Doggie/Sources/DoggieCore/Foundation/MappedBuffer.swift:287:9)
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           0x000000011391bbb7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 39
1  swift-frontend           0x000000011391ac38 llvm::sys::RunSignalHandlers() + 248
2  swift-frontend           0x000000011391c210 SignalHandler(int) + 288
3  libsystem_platform.dylib 0x00007ff81b4b3dfd _sigtramp + 29
4  libsystem_platform.dylib 000000000000000000 _sigtramp + 18446603370123018784
5  libsystem_c.dylib        0x00007ff81b3e9d24 abort + 123
6  libsystem_c.dylib        0x00007ff81b3e90cb err + 0
7  swift-frontend           0x0000000113d180e3 swift::Lowering::AbstractionPattern::withSubstitutions(swift::SubstitutionMap) const (.cold.1) + 35
8  swift-frontend           0x000000010eeb50e9 swift::Lowering::AbstractionPattern::withSubstitutions(swift::SubstitutionMap) const + 137
9  swift-frontend           0x000000010e6f8234 getPhysicalStorageTypeData(swift::TypeExpansionContext, swift::Lowering::SILGenModule&, swift::Lowering::SGFAccessKind, swift::AbstractStorageDecl*, swift::SubstitutionMap, swift::CanType) + 116
10 swift-frontend           0x000000010e6eca80 swift::Lowering::LValue::addNonMemberVarComponent(swift::Lowering::SILGenFunction&, swift::SILLocation, swift::VarDecl*, swift::SubstitutionMap, swift::Lowering::LValueOptions, swift::Lowering::SGFAccessKind, swift::AccessStrategy, swift::CanType, llvm::Optional<swift::ActorIsolation>) + 208
11 swift-frontend           0x000000010e6ede9c emitLValueForNonMemberVarDecl(swift::Lowering::SILGenFunction&, swift::SILLocation, swift::ConcreteDeclRef, swift::CanType, swift::Lowering::SGFAccessKind, swift::Lowering::LValueOptions, swift::AccessSemantics, llvm::Optional<swift::ActorIsolation>) + 268
12 swift-frontend           0x000000010e6ee71f SILGenLValue::visitDeclRefExpr(swift::DeclRefExpr*, swift::Lowering::SGFAccessKind, swift::Lowering::LValueOptions) + 287
13 swift-frontend           0x000000010e6ebe29 swift::ASTVisitor<SILGenLValue, swift::Lowering::LValue, void, void, void, void, void, swift::Lowering::SGFAccessKind, swift::Lowering::LValueOptions>::visit(swift::Expr*, swift::Lowering::SGFAccessKind, swift::Lowering::LValueOptions) + 121
14 swift-frontend           0x000000010e6ec399 SILGenLValue::visitRec(swift::Expr*, swift::Lowering::SGFAccessKind, swift::Lowering::LValueOptions, swift::Lowering::AbstractionPattern) + 169
15 swift-frontend           0x000000010e6eff0f SILGenLValue::visitMemberRefExpr(swift::MemberRefExpr*, swift::Lowering::SGFAccessKind, swift::Lowering::LValueOptions) + 751
16 swift-frontend           0x000000010e6ebe59 swift::ASTVisitor<SILGenLValue, swift::Lowering::LValue, void, void, void, void, void, swift::Lowering::SGFAccessKind, swift::Lowering::LValueOptions>::visit(swift::Expr*, swift::Lowering::SGFAccessKind, swift::Lowering::LValueOptions) + 169
17 swift-frontend           0x000000010e6ebce7 swift::Lowering::SILGenFunction::emitLValue(swift::Expr*, swift::Lowering::SGFAccessKind, swift::Lowering::LValueOptions) + 55
18 swift-frontend           0x000000010e6c4b51 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 9057
19 swift-frontend           0x000000010e6b961c swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 60
20 swift-frontend           0x000000010e6ec67e SILGenLValue::visitRec(swift::Expr*, swift::Lowering::SGFAccessKind, swift::Lowering::LValueOptions, swift::Lowering::AbstractionPattern) + 910
21 swift-frontend           0x000000010e6eff0f SILGenLValue::visitMemberRefExpr(swift::MemberRefExpr*, swift::Lowering::SGFAccessKind, swift::Lowering::LValueOptions) + 751
22 swift-frontend           0x000000010e6ebe59 swift::ASTVisitor<SILGenLValue, swift::Lowering::LValue, void, void, void, void, void, swift::Lowering::SGFAccessKind, swift::Lowering::LValueOptions>::visit(swift::Expr*, swift::Lowering::SGFAccessKind, swift::Lowering::LValueOptions) + 169
23 swift-frontend           0x000000010e6ebce7 swift::Lowering::SILGenFunction::emitLValue(swift::Expr*, swift::Lowering::SGFAccessKind, swift::Lowering::LValueOptions) + 55
24 swift-frontend           0x000000010e6c4b51 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 9057
25 swift-frontend           0x000000010e6b961c swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 60
26 swift-frontend           0x000000010e66cc22 (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 3890
27 swift-frontend           0x000000010e65b2e7 (anonymous namespace)::ArgEmitter::emitSingleArg(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 503
28 swift-frontend           0x000000010e66b618 (anonymous namespace)::ArgEmitter::emitPreparedArgs(swift::Lowering::PreparedArguments&&, swift::Lowering::AbstractionPattern) + 200
29 swift-frontend           0x000000010e6781cb (anonymous namespace)::CallSite::emit(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::SILFunctionType>, (anonymous namespace)::ParamLowering&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::SmallVectorImpl<(anonymous namespace)::DelayedArgument>&, swift::ForeignInfo const&) && + 1067
30 swift-frontend           0x000000010e677917 (anonymous namespace)::CallEmission::emitArgumentsForNormalApply(swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::SILFunctionType>, swift::ForeignInfo const&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::Optional<swift::SILLocation>&) + 1511
31 swift-frontend           0x000000010e65fb7c (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 2956
32 swift-frontend           0x000000010e65ca73 swift::Lowering::SILGenFunction::emitApplyExpr(swift::ApplyExpr*, swift::Lowering::SGFContext) + 51
33 swift-frontend           0x000000010e6c28a3 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 179
34 swift-frontend           0x000000010e6b961c swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 60
35 swift-frontend           0x000000010e6c692a swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 16698
36 swift-frontend           0x000000010e6b961c swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 60
37 swift-frontend           0x000000010e69b9da swift::Lowering::SILGenFunction::emitOptionalSome(swift::SILLocation, swift::SILType, llvm::function_ref<swift::Lowering::ManagedValue (swift::Lowering::SILGenFunction&, swift::SILLocation, swift::Lowering::SGFContext)>, swift::Lowering::SGFContext) + 426
38 swift-frontend           0x000000010e6c81d8 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 23016
39 swift-frontend           0x000000010e6b961c swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 60
40 swift-frontend           0x000000010e66c971 (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 3201
41 swift-frontend           0x000000010e65b2e7 (anonymous namespace)::ArgEmitter::emitSingleArg(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 503
42 swift-frontend           0x000000010e66b618 (anonymous namespace)::ArgEmitter::emitPreparedArgs(swift::Lowering::PreparedArguments&&, swift::Lowering::AbstractionPattern) + 200
43 swift-frontend           0x000000010e6781cb (anonymous namespace)::CallSite::emit(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::SILFunctionType>, (anonymous namespace)::ParamLowering&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::SmallVectorImpl<(anonymous namespace)::DelayedArgument>&, swift::ForeignInfo const&) && + 1067
44 swift-frontend           0x000000010e677917 (anonymous namespace)::CallEmission::emitArgumentsForNormalApply(swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::SILFunctionType>, swift::ForeignInfo const&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::Optional<swift::SILLocation>&) + 1511
45 swift-frontend           0x000000010e65fb7c (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 2956
46 swift-frontend           0x000000010e65ca73 swift::Lowering::SILGenFunction::emitApplyExpr(swift::ApplyExpr*, swift::Lowering::SGFContext) + 51
47 swift-frontend           0x000000010e6c28a3 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 179
48 swift-frontend           0x000000010e6b6ad5 swift::Lowering::SILGenFunction::emitExprInto(swift::Expr*, swift::Lowering::Initialization*, llvm::Optional<swift::SILLocation>) + 261
49 swift-frontend           0x000000010e6a335e swift::Lowering::SILGenFunction::emitPatternBinding(swift::PatternBindingDecl*, unsigned int, bool) + 1694
50 swift-frontend           0x000000010e6a35a0 swift::Lowering::SILGenFunction::visitPatternBindingDecl(swift::PatternBindingDecl*, bool) + 64
51 swift-frontend           0x000000010e736536 swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 5094
52 swift-frontend           0x000000010e735145 swift::Lowering::SILGenFunction::emitStmt(swift::Stmt*) + 21
53 swift-frontend           0x000000010e6dcc07 swift::Lowering::SILGenFunction::emitFunction(swift::FuncDecl*) + 439
54 swift-frontend           0x000000010e64bac3 swift::Lowering::SILGenModule::emitFunctionDefinition(swift::SILDeclRef, swift::SILFunction*) + 10739
55 swift-frontend           0x000000010e64d337 emitOrDelayFunction(swift::Lowering::SILGenModule&, swift::SILDeclRef) + 231
56 swift-frontend           0x000000010e6490b8 swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*) + 168
57 swift-frontend           0x000000010e736536 swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 5094
58 swift-frontend           0x000000010e735145 swift::Lowering::SILGenFunction::emitStmt(swift::Stmt*) + 21
59 swift-frontend           0x000000010e6dcc07 swift::Lowering::SILGenFunction::emitFunction(swift::FuncDecl*) + 439
60 swift-frontend           0x000000010e64bac3 swift::Lowering::SILGenModule::emitFunctionDefinition(swift::SILDeclRef, swift::SILFunction*) + 10739
61 swift-frontend           0x000000010e64d337 emitOrDelayFunction(swift::Lowering::SILGenModule&, swift::SILDeclRef) + 231
62 swift-frontend           0x000000010e6490b8 swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*) + 168
63 swift-frontend           0x000000010e747859 SILGenExtension::visitFuncDecl(swift::FuncDecl*) + 153
64 swift-frontend           0x000000010e742e95 SILGenExtension::emitExtension(swift::ExtensionDecl*) + 101
65 swift-frontend           0x000000010e742e25 swift::Lowering::SILGenModule::visitExtensionDecl(swift::ExtensionDecl*) + 21
66 swift-frontend           0x000000010e64fbcb swift::ASTLoweringRequest::evaluate(swift::Evaluator&, swift::ASTLoweringDescriptor) const + 2283
67 swift-frontend           0x000000010e734c38 swift::SimpleRequest<swift::ASTLoweringRequest, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>> (swift::ASTLoweringDescriptor), (swift::RequestFlags)9>::evaluateRequest(swift::ASTLoweringRequest const&, swift::Evaluator&) + 120
68 swift-frontend           0x000000010e653ab3 llvm::Expected<swift::ASTLoweringRequest::OutputType> swift::Evaluator::getResultUncached<swift::ASTLoweringRequest>(swift::ASTLoweringRequest const&) + 387
69 swift-frontend           0x000000010e650eb1 swift::performASTLowering(swift::ModuleDecl*, swift::Lowering::TypeConverter&, swift::SILOptions const&, swift::IRGenOptions const*) + 161
70 swift-frontend           0x000000010e0c0a72 swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 2290
71 swift-frontend           0x000000010e0c37b0 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 784
72 swift-frontend           0x000000010e0c25d0 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3232
73 swift-frontend           0x000000010df1d893 swift::mainEntry(int, char const**) + 1203
74 dyld                     0x000000012866e52e start + 462

Expected behavior
Expect the project to build correctly

Environment (please fill out the following information)
https://ci.swift.org/job/swift-main-source-compat-suite/393
https://ci.swift.org/job/swift-main-source-compat-suite-debug/393/

Additional context
Apple Swift version 5.9-dev (LLVM 0b945a41db5d9af, Swift 56ac0f0c0d010c5)

@justice-adams-apple justice-adams-apple added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Apr 14, 2023
@justice-adams-apple
Copy link
Contributor Author

@eeckstein
Copy link
Contributor

rdar://107642925
Should be fixed by #65177

@AnthonyLatsis AnthonyLatsis added compiler The Swift compiler itself SILGen Area → compiler: The SIL generation stage crash Bug: A crash, i.e., an abnormal termination of software source compatibility suite Flag: An issue that surfaced in the source compatibility suite swift 5.9 labels Apr 16, 2023
@AnthonyLatsis AnthonyLatsis removed the triage needed This issue needs more specific labels label Apr 16, 2023
@AnthonyLatsis
Copy link
Collaborator

Closing since that assertion is gone.

justice-adams-apple added a commit to swiftlang/swift-source-compat-suite that referenced this issue Apr 17, 2023
@AnthonyLatsis AnthonyLatsis linked a pull request May 4, 2023 that will close this issue
@AnthonyLatsis AnthonyLatsis added the generics Feature: generic declarations and types label May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself crash Bug: A crash, i.e., an abnormal termination of software generics Feature: generic declarations and types SILGen Area → compiler: The SIL generation stage source compatibility suite Flag: An issue that surfaced in the source compatibility suite swift 5.9
Projects
None yet
3 participants