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-9147] Compiler crash in lowering #51643

Closed
swift-ci opened this issue Oct 31, 2018 · 1 comment
Closed

[SR-9147] Compiler crash in lowering #51643

swift-ci opened this issue Oct 31, 2018 · 1 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

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-9147
Radar None
Original Reporter charlieMonroe (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate

Attachment: Download

Environment

macOS 10.14.1, Xcode 10.1

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

md5: d13ef493771d77eb71c111a4bae47b80

duplicates:

  • SR-75 Referencing a protocol function crashes the compiler

Issue Description:

The following example crashes both lldb-rpc-server and SourceKitService in Xcode 10.1 (crash report attached):

protocol Foo {
    func x() -> Int
}

extension Foo {
    func x() -> Int {
        return 44
    }
}

class Bar: Foo {
    func x() -> Int {
        let fun = Foo.x(self)
        return (self as Foo).x()
    }
}
@belkadan
Copy link
Contributor

   not existential
UNREACHABLE executed at /Volumes/Data/swift-public/swift/lib/SILGen/SILGenConvert.cpp:1008!
Stack dump:
0.  Program arguments: /Volumes/Data/swift-public/build/ninja/swift-macosx-x86_64/bin/swift -frontend -c -primary-file - -emit-module-path /var/folders/_d/dmrgv26d3bs6lkrks9z825_w0000gn/T/--5663ff.swiftmodule -emit-module-doc-path /var/folders/_d/dmrgv26d3bs6lkrks9z825_w0000gn/T/--5663ff.swiftdoc -target x86_64-apple-darwin17.7.0 -enable-objc-interop -sdk /Volumes/XIA/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.Internal.sdk -g -color-diagnostics -module-name main -o /var/folders/_d/dmrgv26d3bs6lkrks9z825_w0000gn/T/--5663ff.o 
1.  While emitting SIL for 'x()' at <stdin>:12:2
2.  While silgen emitFunction SIL function "@$S4main3BarC1xSiyF".
 for 'x()' at <stdin>:12:2

6  swift                    0x000000010a90de04 llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 532
7  swift                    0x000000010760d544 swift::Lowering::SILGenFunction::emitOpenExistential(swift::SILLocation, swift::Lowering::ManagedValue, swift::ArchetypeType*, swift::SILType, swift::AccessKind) + 1220
8  swift                    0x000000010763281a swift::Lowering::SILGenFunction::emitOpenExistentialExprImpl(swift::OpenExistentialExpr*, llvm::function_ref<void (swift::Expr*)>) + 410
9  swift                    0x00000001076427b1 swift::Lowering::RValue swift::Lowering::SILGenFunction::emitOpenExistentialExpr<swift::Lowering::RValue, (anonymous namespace)::RValueEmitter::visitOpenExistentialExpr(swift::OpenExistentialExpr*, swift::Lowering::SGFContext)::$_17>(swift::OpenExistentialExpr*, (anonymous namespace)::RValueEmitter::visitOpenExistentialExpr(swift::OpenExistentialExpr*, swift::Lowering::SGFContext)::$_17) + 65
10 swift                    0x0000000107634831 swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 3585
11 swift                    0x0000000107628a99 swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 57
12 swift                    0x00000001075df784 (anonymous namespace)::SILGenApply::visitExpr(swift::Expr*) + 36
13 swift                    0x00000001075e1ac2 (anonymous namespace)::SILGenApply::visitApplyExpr(swift::ApplyExpr*) + 2370

@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

3 participants