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-12884] Compiler Crash in Xcode 11.4+ (SILLinkerVisitor::visitProtocolConformance) #55331

Open
swift-ci opened this issue May 26, 2020 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-12884
Radar None
Original Reporter jverdi (JIRA User)
Type Bug
Environment

macOS Catalina 10.15.4

Tested with Xcode 11.4, 11.4.1, and 11.5

Does not reproduce in Xcode 11.3

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

md5: 6839d15beb8e72a6734034f3c63d35cd

Issue Description:

Hi Folks -

I'm experiencing a compiler crash which occurs only when archiving with optimizations on.

At the moment, when the compiler segfaults, it gives me the following stack trace:

While running pass #​2022759 SILModuleTransform "PerformanceSILLinker".
0 swift 0x00000001115674ea PrintStackTraceSignalHandler(void*) + 42
1 swift 0x0000000111566cc0 SignalHandler(int) + 352
2 libsystem_platform.dylib 0x00007fff6a7dd5fd _sigtramp + 29
3 libsystem_platform.dylib 000000000000000000 _sigtramp + 2508335648
4 swift 0x000000010dbff165 swift::SILLinkerVisitor::visitProtocolConformance(swift::ProtocolConformanceRef, llvm::Optionalswift::SILDeclRef const&) + 197
5 swift 0x000000010dbfeac9 swift::SILLinkerVisitor::processFunction(swift::SILFunction*) + 825
6 swift 0x000000010dad1740 (anonymous namespace)::SILLinker::run() + 304
7 swift 0x000000010d9c2d09 swift::SILPassManager::execute() + 2329
8 swift 0x000000010d5c74c8 swift::CompilerInstance::performSILProcessing(swift::SILModule*, swift::UnifiedStatsReporter*) + 7912
9 swift 0x000000010d2c3070 performCompileStepsPostSILGen(swift::CompilerInstance&, swift::CompilerInvocation&, std::_1::unique_ptr<swift::SILModule, std::_1::default_deleteswift::SILModule >, bool, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, bool, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 1712
10 swift 0x000000010d2bab95 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 55813
11 swift 0x000000010d230b73 main + 1283
12 libdyld.dylib 0x00007fff6a5e4cc9 start + 1

This issue seems to be introduced starting in Swift 5.2 (in the toolchains bundled in Xcode 11.4-11.5). I do not experience the issue building with Xcode 11.3.

Here's a code sample that can be used to reproduce the issue:

protocol A {}
protocol B {}

class T: A, B {}

@objcMembers class U {
    func a() { b(T()) }
    func b(_ p: T & B) { c(p) }
    func c(_ p: A & B) { print(p) }
}
@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
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
Projects
None yet
Development

No branches or pull requests

1 participant