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-3670] Calling default implementation as a curried method causes compiler crash #46255

Closed
swift-ci opened this issue Jan 18, 2017 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-3670
Radar None
Original Reporter broadway_lamb (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash
Assignee None
Priority Medium

md5: 838c978fffa3ed95a42bb7a4a1f92526

duplicates:

  • SR-75 Referencing a protocol function crashes the compiler

Issue Description:

protocol P {}

extension P {
    func defaultImplementation() {}
}

class C : P {
    
    func customImplementation() {
        P.defaultImplementation(self)()
    }
}

Tested against swift-DEVELOPMENT-SNAPSHOT-2017-01-17-a.

UNREACHABLE executed at /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/lib/SILGen/SILGenConvert.cpp:803!
0  swift                    0x000000010e838598 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swift                    0x000000010e837776 llvm::sys::RunSignalHandlers() + 86
2  swift                    0x000000010e838c39 SignalHandler(int) + 361
3  libsystem_platform.dylib 0x00007fffc0333bba _sigtramp + 26
4  libsystem_platform.dylib 0x00007fff54495fa0 _sigtramp + 2484478976
5  libsystem_c.dylib        0x00007fffc01ba420 abort + 129
6  swift                    0x000000010e7d1d27 llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 471
7  swift                    0x000000010be8f01e swift::Lowering::SILGenFunction::emitOpenExistential(swift::SILLocation, swift::Lowering::ManagedValue, swift::CanTypeWrapper<swift::ArchetypeType>, swift::SILType) + 926
8  swift                    0x000000010bea5c42 swift::Lowering::SILGenFunction::emitOpenExistentialExprImpl(swift::OpenExistentialExpr*, llvm::function_ref<void (swift::Expr*)>) + 546
9  swift                    0x000000010beb20a1 swift::Lowering::RValue swift::Lowering::SILGenFunction::emitOpenExistentialExpr<swift::Lowering::RValue, (anonymous namespace)::RValueEmitter::visitOpenExistentialExpr(swift::OpenExistentialExpr*, swift::Lowering::SGFContext)::$_4>(swift::OpenExistentialExpr*, (anonymous namespace)::RValueEmitter::visitOpenExistentialExpr(swift::OpenExistentialExpr*, swift::Lowering::SGFContext)::$_4) + 65
10 swift                    0x000000010bea8db0 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 8736
11 swift                    0x000000010bea52ed swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 61
12 swift                    0x000000010be6d244 (anonymous namespace)::SILGenApply::visitExpr(swift::Expr*) + 36
13 swift                    0x000000010be71115 (anonymous namespace)::SILGenApply::visitApplyExpr(swift::ApplyExpr*) + 5013
14 swift                    0x000000010be71115 (anonymous namespace)::SILGenApply::visitApplyExpr(swift::ApplyExpr*) + 5013
15 swift                    0x000000010be5c861 prepareApplyExpr(swift::Lowering::SILGenFunction&, swift::Expr*) + 161
16 swift                    0x000000010be5c795 swift::Lowering::SILGenFunction::emitApplyExpr(swift::Expr*, swift::Lowering::SGFContext) + 37
17 swift                    0x000000010bea6be5 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 85
18 swift                    0x000000010bea55b6 swift::Lowering::SILGenFunction::emitIgnoredExpr(swift::Expr*) + 470
19 swift                    0x000000010bef9dcd swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 653
20 swift                    0x000000010bef9b35 swift::Lowering::SILGenFunction::emitStmt(swift::Stmt*) + 21
21 swift                    0x000000010beba40e swift::Lowering::SILGenFunction::emitFunction(swift::FuncDecl*) + 462
22 swift                    0x000000010be571c8 swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*)::$_1::operator()(swift::SILFunction*) const + 216
23 swift                    0x000000010be4d930 swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*) + 640
24 swift                    0x000000010beff22f (anonymous namespace)::SILGenType::emitType() + 959
25 swift                    0x000000010befee0d swift::Lowering::SILGenModule::visitNominalTypeDecl(swift::NominalTypeDecl*) + 29
26 swift                    0x000000010be53c3b swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*, unsigned int) + 747
27 swift                    0x000000010be54ca5 swift::SILModule::constructSIL(swift::ModuleDecl*, swift::SILOptions&, swift::FileUnit*, llvm::Optional<unsigned int>, bool, bool) + 949
28 swift                    0x000000010be551c5 swift::performSILGeneration(swift::FileUnit&, swift::SILOptions&, llvm::Optional<unsigned int>, bool) + 117
29 swift                    0x000000010b7b189b swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 13595
30 swift                    0x000000010b769341 main + 3025
31 libdyld.dylib            0x00007fffc0126255 start + 1
Stack dump:
0.  Program arguments: /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2017-01-17-a.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/sergej/Desktop/test/test/main.swift -target x86_64-apple-macosx10.9 -enable-objc-interop -color-diagnostics -module-name main -o /var/folders/m2/y2qb_r75011490596v48b1r80000gn/T/main-a29823.o 
1.  While emitting SIL for 'customImplementation' at /Users/sergej/Desktop/test/test/main.swift:17:5
<unknown>:0: error: unable to execute command: Abort trap: 6
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
@belkadan
Copy link
Contributor

Huh, I thought @slavapestov fixed this. I guess not.

@slavapestov
Copy link
Member

There are many related problems. I fixed a few. This one, I did not fix yet 🙂

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
This issue was closed.
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 in itself crash Bug: A crash, i.e., an abnormal termination of software
Projects
None yet
Development

No branches or pull requests

4 participants