Skip to content

[SourceKit] Add test case for crash triggered in swift::TypeChecker::getTypeOfRValue(…) #5225

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 11, 2016
Merged

[SourceKit] Add test case for crash triggered in swift::TypeChecker::getTypeOfRValue(…) #5225

merged 1 commit into from
Oct 11, 2016

Conversation

practicalswift
Copy link
Contributor

Stack trace:

found code completion token A at offset 200
swift-ide-test: /path/to/swift/lib/AST/Decl.cpp:1684: swift::Type swift::ValueDecl::getInterfaceType() const: Assertion `!isa<AbstractFunctionDecl>(this) && "functions should have an interface type"' failed.
8  swift-ide-test  0x0000000000a5d4ac swift::TypeChecker::getTypeOfRValue(swift::ValueDecl*, bool) + 28
9  swift-ide-test  0x0000000000a5d713 swift::TypeChecker::getUnopenedTypeOfReference(swift::ValueDecl*, swift::Type, swift::DeclContext*, swift::DeclRefExpr const*, bool) + 83
10 swift-ide-test  0x0000000000ac40cd swift::constraints::ConstraintSystem::getTypeOfReference(swift::ValueDecl*, bool, bool, swift::FunctionRefKind, swift::constraints::ConstraintLocatorBuilder, swift::DeclRefExpr const*) + 205
11 swift-ide-test  0x0000000000ac695f swift::constraints::ConstraintSystem::resolveOverload(swift::constraints::ConstraintLocator*, swift::Type, swift::constraints::OverloadChoice) + 671
16 swift-ide-test  0x0000000000c5a9fe swift::Expr::walk(swift::ASTWalker&) + 46
17 swift-ide-test  0x00000000009d3338 swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*) + 200
18 swift-ide-test  0x00000000009f6b7d swift::constraints::ConstraintSystem::solve(swift::Expr*&, swift::Type, swift::ExprTypeCheckListener*, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 77
19 swift-ide-test  0x0000000000a0f96b 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>) + 347
20 swift-ide-test  0x0000000000a124be swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 942
21 swift-ide-test  0x0000000000a15755 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 309
22 swift-ide-test  0x0000000000a1595d swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 237
27 swift-ide-test  0x0000000000a26426 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
30 swift-ide-test  0x0000000000a96b53 swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 355
31 swift-ide-test  0x0000000000a969a7 swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 39
32 swift-ide-test  0x0000000000a4e781 swift::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 657
36 swift-ide-test  0x0000000000c5ade4 swift::Decl::walk(swift::ASTWalker&) + 20
37 swift-ide-test  0x0000000000caf36e swift::SourceFile::walk(swift::ASTWalker&) + 174
38 swift-ide-test  0x0000000000cae67f swift::ModuleDecl::walk(swift::ASTWalker&) + 95
39 swift-ide-test  0x0000000000c851f4 swift::DeclContext::walkContext(swift::ASTWalker&) + 180
40 swift-ide-test  0x00000000009884f8 swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 136
41 swift-ide-test  0x00000000008388f1 swift::CompilerInstance::performSema() + 3697
42 swift-ide-test  0x00000000007d9111 main + 42417
Stack dump:
0.  Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.  While walking into decl getter for a at <INPUT-FILE>:4:5
2.  While type-checking declaration 0x5aa4dd0 at <INPUT-FILE>:7:1
3.  While type-checking expression at [<INPUT-FILE>:7:17 - line:7:19] RangeText="a{"

…getTypeOfRValue(swift::ValueDecl*, bool)

Stack trace:

```
found code completion token A at offset 200
swift-ide-test: /path/to/swift/lib/AST/Decl.cpp:1684: swift::Type swift::ValueDecl::getInterfaceType() const: Assertion `!isa<AbstractFunctionDecl>(this) && "functions should have an interface type"' failed.
8  swift-ide-test  0x0000000000a5d4ac swift::TypeChecker::getTypeOfRValue(swift::ValueDecl*, bool) + 28
9  swift-ide-test  0x0000000000a5d713 swift::TypeChecker::getUnopenedTypeOfReference(swift::ValueDecl*, swift::Type, swift::DeclContext*, swift::DeclRefExpr const*, bool) + 83
10 swift-ide-test  0x0000000000ac40cd swift::constraints::ConstraintSystem::getTypeOfReference(swift::ValueDecl*, bool, bool, swift::FunctionRefKind, swift::constraints::ConstraintLocatorBuilder, swift::DeclRefExpr const*) + 205
11 swift-ide-test  0x0000000000ac695f swift::constraints::ConstraintSystem::resolveOverload(swift::constraints::ConstraintLocator*, swift::Type, swift::constraints::OverloadChoice) + 671
16 swift-ide-test  0x0000000000c5a9fe swift::Expr::walk(swift::ASTWalker&) + 46
17 swift-ide-test  0x00000000009d3338 swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*) + 200
18 swift-ide-test  0x00000000009f6b7d swift::constraints::ConstraintSystem::solve(swift::Expr*&, swift::Type, swift::ExprTypeCheckListener*, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 77
19 swift-ide-test  0x0000000000a0f96b 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>) + 347
20 swift-ide-test  0x0000000000a124be swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 942
21 swift-ide-test  0x0000000000a15755 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 309
22 swift-ide-test  0x0000000000a1595d swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 237
27 swift-ide-test  0x0000000000a26426 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
30 swift-ide-test  0x0000000000a96b53 swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 355
31 swift-ide-test  0x0000000000a969a7 swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 39
32 swift-ide-test  0x0000000000a4e781 swift::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 657
36 swift-ide-test  0x0000000000c5ade4 swift::Decl::walk(swift::ASTWalker&) + 20
37 swift-ide-test  0x0000000000caf36e swift::SourceFile::walk(swift::ASTWalker&) + 174
38 swift-ide-test  0x0000000000cae67f swift::ModuleDecl::walk(swift::ASTWalker&) + 95
39 swift-ide-test  0x0000000000c851f4 swift::DeclContext::walkContext(swift::ASTWalker&) + 180
40 swift-ide-test  0x00000000009884f8 swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 136
41 swift-ide-test  0x00000000008388f1 swift::CompilerInstance::performSema() + 3697
42 swift-ide-test  0x00000000007d9111 main + 42417
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While walking into decl getter for a at <INPUT-FILE>:4:5
2.	While type-checking declaration 0x5aa4dd0 at <INPUT-FILE>:7:1
3.	While type-checking expression at [<INPUT-FILE>:7:17 - line:7:19] RangeText="a{"
```
@practicalswift
Copy link
Contributor Author

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit c30f8df into swiftlang:master Oct 11, 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.

2 participants