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-9002] Compiler crash: swift::FunctionType::get(llvm::ArrayRef<swift::AnyFunctionType::Param>, swift::Type, swift::AnyFunctionType::ExtInfo) #51505

Closed
nathawes opened this issue Oct 15, 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

@nathawes
Copy link
Collaborator

Previous ID SR-9002
Radar rdar://problem/45277222
Original Reporter @nathawes
Type Bug
Status Resolved
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash
Assignee None
Priority Medium

md5: bef38efcd81e034f5e7f436a786fcd9a

duplicates:

  • SR-8984 Compiler crash: swift::GenericEnvironment::mapTypeIntoContext(swift::GenericEnvironment*, swift::Type)

Issue Description:

To reproduce:

$ git clone https://github.com/bignerdranch/Deferred.git
$ cd Deferred
$ git checkout -f c374a6e7072ed88ed0c79299098ca2ba7c27e720
$ open Deferred.xcodeproj 

Then in Xcode:

  1. Select the October 3 swift.org dev snapshot toolchain

  2. Navigate to Either.swift

  3. Replace the file contents with the below:

    @available(swift, deprecated: 100000)
    public protocol Either {
    
    extension Either where Left == Error {
        /// Derive a success value by calling a failable function `body`.
        @_inlineable
        public init(from
  1. Build to get the crash below:

    Application Specific Information:
    Stack dump:
    0.  Program arguments: /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2018-10-03-a.xctoolchain/usr/bin/swift -frontend -c ...
    1.  While type-checking 'Either' at /Users/nathanhawes/workspace/open-swift-source-compat-suite-master/project_cache/Deferred/Sources/Task/Either.swift:2:8
    2.  While type-checking extension of Either at /Users/nathanhawes/workspace/open-swift-source-compat-suite-master/project_cache/Deferred/Sources/Task/Either.swift:4:3
    3.  While type-checking 'init()' at /Users/nathanhawes/workspace/open-swift-source-compat-suite-master/project_cache/Deferred/Sources/Task/Either.swift:7:12
    4.  While validating 'init()' at /Users/nathanhawes/workspace/open-swift-source-compat-suite-master/project_cache/Deferred/Sources/Task/Either.swift:7:12
     
    
    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0   swift                           0x000000011061c9e2 swift::FunctionType::get(llvm::ArrayRef<swift::AnyFunctionType::Param>, swift::Type, swift::AnyFunctionType::ExtInfo) + 98
    1   swift                           0x00000001106bc264 swift::AbstractFunctionDecl::computeType(swift::AnyFunctionType::ExtInfo) + 436
    2   swift                           0x00000001103da357 swift::TypeChecker::validateGenericFuncSignature(swift::AbstractFunctionDecl*) + 1559
    3   swift                           0x00000001103ae95b swift::TypeChecker::validateDecl(swift::ValueDecl*) + 7067
    4   swift                           0x00000001103a9a62 (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 258
    5   swift                           0x00000001103b82bb (anonymous namespace)::DeclChecker::visitExtensionDecl(swift::ExtensionDecl*) + 443
    6   swift                           0x00000001103a9a44 (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 228
    7   swift                           0x00000001103b7a0b (anonymous namespace)::DeclChecker::visitProtocolDecl(swift::ProtocolDecl*) + 587
    8   swift                           0x00000001103a9f9d (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 1597
    9   swift                           0x00000001103a9956 swift::TypeChecker::typeCheckDecl(swift::Decl*) + 38
    10  swift                           0x0000000110443218 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) + 1944
    11  swift                           0x00000001100e4a35 swift::CompilerInstance::parseAndCheckTypesUpTo(swift::CompilerInstance::ImplicitImports const&, swift::SourceFile::ASTStage_t) + 629
    12  swift                           0x00000001100e4038 swift::CompilerInstance::performSemaUpTo(swift::SourceFile::ASTStage_t) + 616
    13  swift                           0x000000010f41e067 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 1335
    14  swift                           0x000000010f41ca9d swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3021
    15  swift                           0x000000010f3cef0e main + 686
    16  libdyld.dylib                   0x00007fff742fd085 start + 1
@nathawes
Copy link
Collaborator Author

@swift-ci create

@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

2 participants