Skip to content

[SourceKit] Add test case for crash triggered in swift::constraints::ConstraintGraph::Change::addedTypeVariable(…) #5342

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

Merged
merged 1 commit into from
Oct 19, 2016
Merged

[SourceKit] Add test case for crash triggered in swift::constraints::ConstraintGraph::Change::addedTypeVariable(…) #5342

merged 1 commit into from
Oct 19, 2016

Conversation

practicalswift
Copy link
Contributor

Stack trace:

found code completion token A at offset 142
swift-ide-test: /path/to/swift/lib/Sema/ConstraintGraph.cpp:50: std::pair<ConstraintGraphNode &, unsigned int> swift::constraints::ConstraintGraph::lookupNode(swift::TypeVariableType *): Assertion `impl.getGraphIndex() < TypeVariables.size() && "Out-of-bounds index"' failed.
7  swift-ide-test  0x0000000000ab9080 swift::constraints::ConstraintGraph::Change::addedTypeVariable(swift::TypeVariableType*) + 0
8  swift-ide-test  0x0000000000abab32 swift::constraints::ConstraintGraph::addConstraint(swift::constraints::Constraint*) + 130
9  swift-ide-test  0x0000000000ac5d96 swift::constraints::ConstraintSystem::addConstraint(swift::constraints::Constraint*, bool, bool) + 246
10 swift-ide-test  0x00000000009dc750 swift::isExtensionApplied(swift::DeclContext&, swift::Type, swift::ExtensionDecl const*) + 944
16 swift-ide-test  0x0000000000a691f0 swift::TypeChecker::performTypoCorrection(swift::DeclContext*, swift::DeclRefKind, swift::Type, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>, swift::LookupResult&, unsigned int) + 272
18 swift-ide-test  0x0000000000aebe63 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 1987
19 swift-ide-test  0x0000000000af1a00 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4320
20 swift-ide-test  0x0000000000a128cf swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 431
21 swift-ide-test  0x0000000000a1536e swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 942
24 swift-ide-test  0x0000000000aeb71b swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 123
25 swift-ide-test  0x0000000000af1a00 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4320
26 swift-ide-test  0x0000000000a128cf swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 431
27 swift-ide-test  0x0000000000a1536e swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 942
30 swift-ide-test  0x0000000000aeb706 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 102
31 swift-ide-test  0x0000000000af1a00 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4320
32 swift-ide-test  0x0000000000a128cf swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 431
33 swift-ide-test  0x0000000000a1536e swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 942
38 swift-ide-test  0x0000000000aeb706 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 102
39 swift-ide-test  0x0000000000af1a00 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4320
40 swift-ide-test  0x0000000000a128cf swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 431
41 swift-ide-test  0x0000000000a1536e swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 942
43 swift-ide-test  0x0000000000a9ab56 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
44 swift-ide-test  0x0000000000a51897 swift::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 647
47 swift-ide-test  0x000000000098ac31 swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 305
48 swift-ide-test  0x00000000008393f1 swift::CompilerInstance::performSema() + 3697
49 swift-ide-test  0x00000000007d9894 main + 42916
Stack dump:
0.  Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.  While type-checking expression at [<INPUT-FILE>:3:1 - line:4:2] RangeText="assert(Range.b
v"
2.  While type-checking expression at [<INPUT-FILE>:3:7 - line:4:2] RangeText="(Range.b
v"
3.  While type-checking expression at [<INPUT-FILE>:3:8 - line:3:14] RangeText="Range.b"
4.  While type-checking expression at [<INPUT-FILE>:3:8 - line:3:14] RangeText="Range.b"

…ConstraintGraph::Change::addedTypeVariable(swift::TypeVariableType*)

Stack trace:

```
found code completion token A at offset 142
swift-ide-test: /path/to/swift/lib/Sema/ConstraintGraph.cpp:50: std::pair<ConstraintGraphNode &, unsigned int> swift::constraints::ConstraintGraph::lookupNode(swift::TypeVariableType *): Assertion `impl.getGraphIndex() < TypeVariables.size() && "Out-of-bounds index"' failed.
7  swift-ide-test  0x0000000000ab9080 swift::constraints::ConstraintGraph::Change::addedTypeVariable(swift::TypeVariableType*) + 0
8  swift-ide-test  0x0000000000abab32 swift::constraints::ConstraintGraph::addConstraint(swift::constraints::Constraint*) + 130
9  swift-ide-test  0x0000000000ac5d96 swift::constraints::ConstraintSystem::addConstraint(swift::constraints::Constraint*, bool, bool) + 246
10 swift-ide-test  0x00000000009dc750 swift::isExtensionApplied(swift::DeclContext&, swift::Type, swift::ExtensionDecl const*) + 944
16 swift-ide-test  0x0000000000a691f0 swift::TypeChecker::performTypoCorrection(swift::DeclContext*, swift::DeclRefKind, swift::Type, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>, swift::LookupResult&, unsigned int) + 272
18 swift-ide-test  0x0000000000aebe63 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 1987
19 swift-ide-test  0x0000000000af1a00 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4320
20 swift-ide-test  0x0000000000a128cf swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 431
21 swift-ide-test  0x0000000000a1536e swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 942
24 swift-ide-test  0x0000000000aeb71b swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 123
25 swift-ide-test  0x0000000000af1a00 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4320
26 swift-ide-test  0x0000000000a128cf swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 431
27 swift-ide-test  0x0000000000a1536e swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 942
30 swift-ide-test  0x0000000000aeb706 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 102
31 swift-ide-test  0x0000000000af1a00 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4320
32 swift-ide-test  0x0000000000a128cf swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 431
33 swift-ide-test  0x0000000000a1536e swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 942
38 swift-ide-test  0x0000000000aeb706 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 102
39 swift-ide-test  0x0000000000af1a00 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4320
40 swift-ide-test  0x0000000000a128cf swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 431
41 swift-ide-test  0x0000000000a1536e swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 942
43 swift-ide-test  0x0000000000a9ab56 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
44 swift-ide-test  0x0000000000a51897 swift::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 647
47 swift-ide-test  0x000000000098ac31 swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 305
48 swift-ide-test  0x00000000008393f1 swift::CompilerInstance::performSema() + 3697
49 swift-ide-test  0x00000000007d9894 main + 42916
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While type-checking expression at [<INPUT-FILE>:3:1 - line:4:2] RangeText="assert(Range.b
v"
2.	While type-checking expression at [<INPUT-FILE>:3:7 - line:4:2] RangeText="(Range.b
v"
3.	While type-checking expression at [<INPUT-FILE>:3:8 - line:3:14] RangeText="Range.b"
4.	While type-checking expression at [<INPUT-FILE>:3:8 - line:3:14] RangeText="Range.b"
```
@practicalswift
Copy link
Contributor Author

@swift-ci please smoke test and merge

@practicalswift practicalswift merged commit cf51c9c into swiftlang:master Oct 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant