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-9005] Compiler crash: swift::GenericEnvironment::mapTypeIntoContext(swift::GenericEnvironment*, swift::Type) – different trace to SR-8984 #51508

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-9005
Radar rdar://problem/45279827
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: 66878c587b141cff246628ec90544c51

duplicates:

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

Issue Description:

Possibly a dupe of SR-8984 but the trace is quite different

To reproduce:

$ git clone https://github.com/vapor/fluent
$ cd fluent
$ git checkout -f 270b6fa372f03809b9795e8f8b9d1c31267a0ff3
$ swift package generate-xcodeproj
$ open Fluent.xcodeproj

Then in Xcode:

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

  2. Navigate to SQL+JoinSupporting.swift

  3. Replace the file contents with the below:

    extension JoinSupporting where
        QueryJoin: SQLJoin,
        QueryJoinMethod == QueryJoin.Method,
        QueryJoin.Expression.ColumnIdentifier.TableIdentifier == QueryJoin.TableIdentifier
    {
    
    extension JoinSupporting where QueryJoinMethod: SQLJoinMethod {
        /// See `JoinSupporting`.
        public static var queryJoinMethodDefault: QueryJoinMethod {
            return .default
        }
    }
    
    extension JoinSupporting where Query: FluentSQLQuery, QueryJoin == Query.Join {
        /// See `JoinSupporting`.
        public static func queryJoinApply(_ join: QueryJoin, to query
  4. Build to get the trace below:

    Application Specific Information:
    Stack dump:
    0.  Program arguments: /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2018-10-03-a.xctoolchain/usr/bin/swift -frontend -typecheck ... 
    1.  While type-checking extension of JoinSupporting at /Users/nathanhawes/workspace/open-swift-source-compat-suite-master/project_cache/fluent/Sources/FluentSQL/SQL+JoinSupporting.swift:1:1
    2.  While type-checking extension of JoinSupporting at /Users/nathanhawes/workspace/open-swift-source-compat-suite-master/project_cache/fluent/Sources/FluentSQL/SQL+JoinSupporting.swift:7:3
    3.  While type-checking declaration 0x7fdf7719bf00 at /Users/nathanhawes/workspace/open-swift-source-compat-suite-master/project_cache/fluent/Sources/FluentSQL/SQL+JoinSupporting.swift:9:12
    4.  While resolving type QueryJoinMethod at [/Users/nathanhawes/workspace/open-swift-source-compat-suite-master/project_cache/fluent/Sources/FluentSQL/SQL+JoinSupporting.swift:9:47 - line:9:47] RangeText=""
     
    
    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0   swift                           0x000000010ae3a9ac swift::GenericEnvironment::mapTypeIntoContext(swift::GenericEnvironment*, swift::Type) + 12
    1   swift                           0x000000010ab7a4fc swift::TypeChecker::resolveTypeInContext(swift::TypeDecl*, swift::DeclContext*, swift::TypeResolution, swift::TypeResolutionOptions, bool) + 444
    2   swift                           0x000000010ab7e922 resolveTypeDecl(swift::TypeDecl*, swift::SourceLoc, swift::DeclContext*, swift::TypeResolution, swift::GenericIdentTypeRepr*, swift::TypeResolutionOptions) + 210
    3   swift                           0x000000010ab7c669 resolveIdentTypeComponent(swift::TypeResolution, llvm::ArrayRef<swift::ComponentIdentTypeRepr*>, swift::TypeResolutionOptions) + 1065
    4   swift                           0x000000010ab7be4b swift::TypeChecker::resolveIdentifierType(swift::TypeResolution, swift::IdentTypeRepr*, swift::TypeResolutionOptions) + 155
    5   swift                           0x000000010ab7d25a (anonymous namespace)::TypeResolver::resolveType(swift::TypeRepr*, swift::TypeResolutionOptions) + 282
    6   swift                           0x000000010ab7b4a1 swift::TypeResolution::resolveType(swift::TypeRepr*, swift::TypeResolutionOptions) + 225
    7   swift                           0x000000010ab7d0b2 swift::TypeChecker::validateType(swift::TypeLoc&, swift::TypeResolution, swift::TypeResolutionOptions) + 98
    8   swift                           0x000000010ab27700 validateTypedPattern(swift::TypeChecker&, swift::TypeResolution, swift::TypedPattern*, swift::TypeResolutionOptions) + 112
    9   swift                           0x000000010ab2723e swift::TypeChecker::typeCheckPattern(swift::Pattern*, swift::DeclContext*, swift::TypeResolutionOptions) + 350
    10  swift                           0x000000010aaf6780 validatePatternBindingEntries(swift::TypeChecker&, swift::PatternBindingDecl*) + 656
    11  swift                           0x000000010aaeecd4 (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 884
    12  swift                           0x000000010aafd2bb (anonymous namespace)::DeclChecker::visitExtensionDecl(swift::ExtensionDecl*) + 443
    13  swift                           0x000000010aaeea44 (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 228
    14  swift                           0x000000010aafd2bb (anonymous namespace)::DeclChecker::visitExtensionDecl(swift::ExtensionDecl*) + 443
    15  swift                           0x000000010aaeea44 (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 228
    16  swift                           0x000000010aaee956 swift::TypeChecker::typeCheckDecl(swift::Decl*) + 38
    17  swift                           0x000000010ab88218 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) + 1944
    18  swift                           0x000000010a829a35 swift::CompilerInstance::parseAndCheckTypesUpTo(swift::CompilerInstance::ImplicitImports const&, swift::SourceFile::ASTStage_t) + 629
    19  swift                           0x000000010a829038 swift::CompilerInstance::performSemaUpTo(swift::SourceFile::ASTStage_t) + 616
    20  swift                           0x0000000109b63067 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 1335
    21  swift                           0x0000000109b61a9d swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3021
    22  swift                           0x0000000109b13f0e main + 686
    23  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