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-12657] Swift 5.2 compiler crash, protocol method reference #55100

Closed
swift-ci opened this issue Apr 23, 2020 · 1 comment
Closed

[SR-12657] Swift 5.2 compiler crash, protocol method reference #55100

swift-ci opened this issue Apr 23, 2020 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-12657
Radar None
Original Reporter ruzili (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Environment

MacOS 10.15.4 (19E287), MacBook Pro (15-inch, 2018)

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

md5: c2fa611cc1bae40e462e12bbad03bc42

duplicates:

  • SR-75 Referencing a protocol function crashes the compiler

Issue Description:

The following code snippet crashes the Swift 5.2 compiler with a segmentation fault.

protocol Something {
    func add(_ n: Int)
}

let function = Something.add

Here is the stacktrace

1.  Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)
0  swift                    0x000000011369f4ea PrintStackTraceSignalHandler(void*) + 42
1  swift                    0x000000011369ecc0 SignalHandler(int) + 352
2  libsystem_platform.dylib 0x00007fff6db7d5fd _sigtramp + 29
3  libsystem_platform.dylib 0x00007ffee08b1f48 _sigtramp + 1926449512
4  swift                    0x000000010f8885fa swift::Lowering::SILGenFunction::emitOpenExistentialExprImpl(swift::OpenExistentialExpr*, llvm::function_ref<void (swift::Expr*)>) + 666
5  swift                    0x000000010f87979a swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 38938
6  swift                    0x000000010f86fd93 swift::Lowering::SILGenFunction::emitExprInto(swift::Expr*, swift::Lowering::Initialization*, llvm::Optional<swift::SILLocation>) + 131
7  swift                    0x000000010f863c18 swift::Lowering::SILGenFunction::emitPatternBinding(swift::PatternBindingDecl*, unsigned int) + 280
8  swift                    0x000000010f80ec5d swift::ASTVisitor<swift::Lowering::SILGenFunction, void, void, void, void, void, void>::visit(swift::Decl*) + 109
9  swift                    0x000000010f8105f1 swift::ASTVisitor<swift::Lowering::SILGenModule, void, void, void, void, void, void>::visit(swift::Decl*) + 1265
10 swift                    0x000000010f80f31c swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*) + 1356
11 swift                    0x000000010f81139e swift::SILModule::constructSIL(swift::ModuleDecl*, swift::Lowering::TypeConverter&, swift::SILOptions&, swift::FileUnit*) + 1438
12 swift                    0x000000010f3f1131 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 48065
13 swift                    0x000000010f368f53 main + 1283
14 libdyld.dylib            0x00007fff6d984cc9 start + 1
15 libdyld.dylib            0x0000000000000045 start + 2456269693
error: Segmentation fault: 11
@hamishknight
Copy link
Collaborator

Fixed in 5.3! You can try out a development snapshot from https://swift.org/download/#snapshots.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 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.
Projects
None yet
Development

No branches or pull requests

2 participants