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-12966] Compiler crash when using enum case as witness with library evolution on #55412

Closed
theblixguy opened this issue Jun 9, 2020 · 2 comments
Assignees
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 SILGen Area → compiler: The SIL generation stage

Comments

@theblixguy
Copy link
Collaborator

Previous ID SR-12966
Radar rdar://problem/70395861
Original Reporter @theblixguy
Type Bug
Status Resolved
Resolution Done
Environment

Swift version 5.3-dev (LLVM 94f1132, Swift 87b4a5f6b2)
macOS 10.15.4 (19E287)
Xcode 11.4.1 (11E503a)

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

md5: 2dcf0383756eb573988671b6efc5954a

Issue Description:

public protocol PublicProtoFoo {
  static var bar: Self { get }
}

public enum PublicEnumFoo: PublicProtoFoo {
  case bar
}
Assertion failed: (enumTI.isLoadable() || !silConv.useLoweredAddresses()), function emitEnumConstructor, file /Users/spare/Documents/swift-src/swift/lib/SILGen/SILGenConstructor.cpp, line 534.
Stack dump:
0.  Program arguments: ./swiftc -frontend -emit-ir -enable-library-evolution -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk /Users/spare/Desktop/test.swift
1.  Swift version 5.3-dev (LLVM 94f1132277, Swift 87b4a5f6b2)
2.  While evaluating request ASTLoweringRequest(Lowering AST to SIL for module test)
3.  While silgen enum constructor SIL function "@$s4test13PublicEnumFooO3baryA2CmF".
 for 'bar' (at /Users/spare/Desktop/test.swift:6:8)
0  swiftc                   0x00000001114055d8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swiftc                   0x0000000111404825 llvm::sys::RunSignalHandlers() + 85
2  swiftc                   0x0000000111405ba6 SignalHandler(int) + 262
3  libsystem_platform.dylib 0x00007fff6b8a55fd _sigtramp + 29
4  swiftc                   0x0000000113d1c928 cmark_strbuf__initbuf + 172376
5  libsystem_c.dylib        0x00007fff6b77b808 abort + 120
6  libsystem_c.dylib        0x00007fff6b77aac6 err + 0
7  swiftc                   0x00000001115d56f3 swift::Lowering::SILGenFunction::emitEnumConstructor(swift::EnumElementDecl*) (.cold.5) + 35
8  swiftc                   0x000000010d61315a swift::Lowering::SILGenFunction::emitEnumConstructor(swift::EnumElementDecl*) + 2650
9  swiftc                   0x000000010d5cfcd6 emitDelayedFunction(swift::Lowering::SILGenModule&, swift::SILDeclRef, swift::SILFunction*) + 918
10 swiftc                   0x000000010d5cf059 swift::ASTLoweringRequest::evaluate(swift::Evaluator&, swift::ASTLoweringDescriptor) const + 5625
11 swiftc                   0x000000010d6a7441 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&) + 33
12 swiftc                   0x000000010d5d3da9 llvm::Expected<swift::ASTLoweringRequest::OutputType> swift::Evaluator::getResultUncached<swift::ASTLoweringRequest>(swift::ASTLoweringRequest const&) + 345
13 swiftc                   0x000000010d5cf4fd llvm::Expected<swift::ASTLoweringRequest::OutputType> swift::Evaluator::operator()<swift::ASTLoweringRequest, (void*)0>(swift::ASTLoweringRequest const&) + 61
14 swiftc                   0x000000010d5cf444 swift::performASTLowering(swift::ModuleDecl*, swift::Lowering::TypeConverter&, swift::SILOptions const&) + 116
15 swiftc                   0x000000010d2a2cde performCompile(swift::CompilerInstance&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) + 7790
16 swiftc                   0x000000010d29fe89 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3529
17 swiftc                   0x000000010d24116d main + 861
18 libdyld.dylib            0x00007fff6b6accc9 start + 1
19 libdyld.dylib            0x0000000000000007 start + 18446603338714002239
@slavapestov
Copy link
Member

@swift-ci create

@slavapestov
Copy link
Member

#34421

@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 SILGen Area → compiler: The SIL generation stage
Projects
None yet
Development

No branches or pull requests

3 participants