Skip to content

[SourceKit] Add test case for crash triggered in swift::BoundGenericType::getSubstitutions(…) #659

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
Dec 19, 2015
Merged

[SourceKit] Add test case for crash triggered in swift::BoundGenericType::getSubstitutions(…) #659

merged 1 commit into from
Dec 19, 2015

Conversation

practicalswift
Copy link
Contributor

Stack trace:

found code completion token A at offset 115
swift-ide-test: /path/to/llvm/include/llvm/ADT/ArrayRef.h:297: T &llvm::MutableArrayRef<swift::GenericTypeParamDecl *>::operator[](size_t) const [T = swift::GenericTypeParamDecl *]: Assertion `Index < this->size() && "Invalid index!"' failed.
8  swift-ide-test  0x0000000000b67222 swift::BoundGenericType::getSubstitutions(swift::ModuleDecl*, swift::LazyResolver*, swift::DeclContext*) + 2962
9  swift-ide-test  0x0000000000b8a323 swift::TypeBase::gatherAllSubstitutions(swift::ModuleDecl*, llvm::SmallVectorImpl<swift::Substitution>&, swift::LazyResolver*, swift::DeclContext*) + 211
10 swift-ide-test  0x0000000000b6781e swift::ModuleDecl::lookupConformance(swift::Type, swift::ProtocolDecl*, swift::LazyResolver*) + 1246
11 swift-ide-test  0x000000000095be10 swift::TypeChecker::conformsToProtocol(swift::Type, swift::ProtocolDecl*, swift::DeclContext*, swift::OptionSet<swift::ConformanceCheckFlags, unsigned int>, swift::ProtocolConformance**, swift::SourceLoc) + 96
12 swift-ide-test  0x00000000008d9b5b swift::constraints::ConstraintSystem::simplifyConformsToConstraint(swift::Type, swift::ProtocolDecl*, swift::constraints::ConstraintKind, swift::constraints::ConstraintLocatorBuilder, unsigned int) + 123
13 swift-ide-test  0x00000000008d99e3 swift::constraints::ConstraintSystem::matchExistentialTypes(swift::Type, swift::Type, swift::constraints::ConstraintKind, unsigned int, swift::constraints::ConstraintLocatorBuilder) + 211
14 swift-ide-test  0x00000000008dad30 swift::constraints::ConstraintSystem::simplifyRestrictedConstraint(swift::constraints::ConversionRestrictionKind, swift::Type, swift::Type, swift::constraints::TypeMatchKind, unsigned int, swift::constraints::ConstraintLocatorBuilder) + 2512
15 swift-ide-test  0x00000000008d7895 swift::constraints::ConstraintSystem::matchTypes(swift::Type, swift::Type, swift::constraints::TypeMatchKind, unsigned int, swift::constraints::ConstraintLocatorBuilder) + 10101
16 swift-ide-test  0x00000000008d7005 swift::constraints::ConstraintSystem::matchTypes(swift::Type, swift::Type, swift::constraints::TypeMatchKind, unsigned int, swift::constraints::ConstraintLocatorBuilder) + 7909
17 swift-ide-test  0x00000000008e1aef swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 639
18 swift-ide-test  0x00000000009a6177 swift::constraints::ConstraintSystem::addConstraint(swift::constraints::Constraint*, bool, bool) + 23
20 swift-ide-test  0x0000000000911011 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>) + 385
21 swift-ide-test  0x0000000000917539 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
22 swift-ide-test  0x0000000000918650 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 112
23 swift-ide-test  0x00000000009187f9 swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 265
29 swift-ide-test  0x0000000000931ec7 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 151
30 swift-ide-test  0x00000000008fe05a swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1610
31 swift-ide-test  0x000000000076b9b2 swift::CompilerInstance::performSema() + 2946
32 swift-ide-test  0x00000000007152b7 main + 33239
Stack dump:
0.  Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.  While type-checking 'A' at <INPUT-FILE>:2:1
2.  While type-checking expression at [<INPUT-FILE>:2:41 - line:2:41] RangeText="B"

…ype::getSubstitutions(swift::ModuleDecl*, swift::LazyResolver*, swift::DeclContext*)

Stack trace:

```
found code completion token A at offset 115
swift-ide-test: /path/to/llvm/include/llvm/ADT/ArrayRef.h:297: T &llvm::MutableArrayRef<swift::GenericTypeParamDecl *>::operator[](size_t) const [T = swift::GenericTypeParamDecl *]: Assertion `Index < this->size() && "Invalid index!"' failed.
8  swift-ide-test  0x0000000000b67222 swift::BoundGenericType::getSubstitutions(swift::ModuleDecl*, swift::LazyResolver*, swift::DeclContext*) + 2962
9  swift-ide-test  0x0000000000b8a323 swift::TypeBase::gatherAllSubstitutions(swift::ModuleDecl*, llvm::SmallVectorImpl<swift::Substitution>&, swift::LazyResolver*, swift::DeclContext*) + 211
10 swift-ide-test  0x0000000000b6781e swift::ModuleDecl::lookupConformance(swift::Type, swift::ProtocolDecl*, swift::LazyResolver*) + 1246
11 swift-ide-test  0x000000000095be10 swift::TypeChecker::conformsToProtocol(swift::Type, swift::ProtocolDecl*, swift::DeclContext*, swift::OptionSet<swift::ConformanceCheckFlags, unsigned int>, swift::ProtocolConformance**, swift::SourceLoc) + 96
12 swift-ide-test  0x00000000008d9b5b swift::constraints::ConstraintSystem::simplifyConformsToConstraint(swift::Type, swift::ProtocolDecl*, swift::constraints::ConstraintKind, swift::constraints::ConstraintLocatorBuilder, unsigned int) + 123
13 swift-ide-test  0x00000000008d99e3 swift::constraints::ConstraintSystem::matchExistentialTypes(swift::Type, swift::Type, swift::constraints::ConstraintKind, unsigned int, swift::constraints::ConstraintLocatorBuilder) + 211
14 swift-ide-test  0x00000000008dad30 swift::constraints::ConstraintSystem::simplifyRestrictedConstraint(swift::constraints::ConversionRestrictionKind, swift::Type, swift::Type, swift::constraints::TypeMatchKind, unsigned int, swift::constraints::ConstraintLocatorBuilder) + 2512
15 swift-ide-test  0x00000000008d7895 swift::constraints::ConstraintSystem::matchTypes(swift::Type, swift::Type, swift::constraints::TypeMatchKind, unsigned int, swift::constraints::ConstraintLocatorBuilder) + 10101
16 swift-ide-test  0x00000000008d7005 swift::constraints::ConstraintSystem::matchTypes(swift::Type, swift::Type, swift::constraints::TypeMatchKind, unsigned int, swift::constraints::ConstraintLocatorBuilder) + 7909
17 swift-ide-test  0x00000000008e1aef swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 639
18 swift-ide-test  0x00000000009a6177 swift::constraints::ConstraintSystem::addConstraint(swift::constraints::Constraint*, bool, bool) + 23
20 swift-ide-test  0x0000000000911011 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>) + 385
21 swift-ide-test  0x0000000000917539 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
22 swift-ide-test  0x0000000000918650 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 112
23 swift-ide-test  0x00000000009187f9 swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 265
29 swift-ide-test  0x0000000000931ec7 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 151
30 swift-ide-test  0x00000000008fe05a swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1610
31 swift-ide-test  0x000000000076b9b2 swift::CompilerInstance::performSema() + 2946
32 swift-ide-test  0x00000000007152b7 main + 33239
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While type-checking 'A' at <INPUT-FILE>:2:1
2.	While type-checking expression at [<INPUT-FILE>:2:41 - line:2:41] RangeText="B"
```
gribozavr added a commit that referenced this pull request Dec 19, 2015
…generictype-getsubstitutions

[SourceKit] Add test case for crash triggered in swift::BoundGenericType::getSubstitutions(…)
@gribozavr gribozavr merged commit 68d6f4b into swiftlang:master Dec 19, 2015
freak4pc pushed a commit to freak4pc/swift that referenced this pull request Sep 28, 2022
[Stress tester XFails] Update XFails
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