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-9305] reproducible crash when I add a type constraint to generic class #51776

Closed
swift-ci opened this issue Nov 20, 2018 · 1 comment
Closed
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

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-9305
Radar rdar://46173958
Original Reporter justin.garcia (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Xcode 10.0 on macOS 10.14.1

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

md5: 3b26e3f6b69fd1ce6c6fd4b2981b9952

Issue Description:

I have this class:

class PickerSectionProvider<T>: PickerItemProvider {
    func item(at index: Int) -> T? {
        return nil
    }
}

This compiles fine. But when I add a type constraint to T (Syncable), Xcode crashes. The crash is reproducible. Sorry I couldn’t get the crashtrace to paste here without losing line breaks. Here is the very top of the crashtrace (the full crash log is attached):

0   swift                         0x000000010c2344b6 swift::irgen::CallEmission::emitCallSite() + 102
1   swift                         0x000000010c23701c swift::irgen::CallEmission::emitToExplosion(swift::irgen::Explosion&, bool) + 940
2   swift                         0x000000010c3c15cc (anonymous namespace)::IRGenSILFunction::visitFullApplySite(swift::FullApplySite) + 2940
3   swift                         0x000000010c39fdd1 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 9825
4   swift                         0x000000010c282c90 swift::irgen::IRGenerator::emitLazyDefinitions() + 1472
5   swift                         0x000000010c3804ca performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::LLVMContext&, swift::SourceFile*, llvm::GlobalVariable**, unsigned int) + 1562
6   swift                         0x000000010c1c0a10 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 46928

A reduction (an Xcode project) that demonstrates the issue is attached.

@slavapestov
Copy link
Member

Looks like Arnold already merged a fix: #20865

@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