-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[swiftc (42 vs. 5433)] Add crasher in swift::constraints::ConstraintGraph::addConstraint(...) #7006
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
swift-ci
merged 1 commit into
swiftlang:master
from
practicalswift:swiftc-28663-impl-getgraphindex-typevariables-size-out-of-bounds-index
Jan 24, 2017
Merged
[swiftc (42 vs. 5433)] Add crasher in swift::constraints::ConstraintGraph::addConstraint(...) #7006
swift-ci
merged 1 commit into
swiftlang:master
from
practicalswift:swiftc-28663-impl-getgraphindex-typevariables-size-out-of-bounds-index
Jan 24, 2017
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…raph::addConstraint(...) Add test case for crash triggered in `swift::constraints::ConstraintGraph::addConstraint(...)`. Current number of unresolved compiler crashers: 42 (5433 resolved) /cc @DougGregor - just wanted to let you know that this crasher caused an assertion failure for the assertion `impl.getGraphIndex() < TypeVariables.size() && "Out-of-bounds index"` added on 2013-12-09 by you in commit 1179409 :-) Assertion failure in [`lib/Sema/ConstraintGraph.cpp (line 50)`](https://github.com/apple/swift/blob/de771d3819b61a396483ceaf333918f656bad165/lib/Sema/ConstraintGraph.cpp#L50): ``` Assertion `impl.getGraphIndex() < TypeVariables.size() && "Out-of-bounds index"' failed. When executing: std::pair<ConstraintGraphNode &, unsigned int> swift::constraints::ConstraintGraph::lookupNode(swift::TypeVariableType *) ``` Assertion context: ```c++ std::pair<ConstraintGraphNode &, unsigned> ConstraintGraph::lookupNode(TypeVariableType *typeVar) { // Check whether we've already created a node for this type variable. auto &impl = typeVar->getImpl(); if (auto nodePtr = impl.getGraphNode()) { assert(impl.getGraphIndex() < TypeVariables.size() && "Out-of-bounds index"); assert(TypeVariables[impl.getGraphIndex()] == typeVar && "Type variable mismatch"); return { *nodePtr, impl.getGraphIndex() }; } ``` Stack trace: ``` 0 0x000000000389c558 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x389c558) 1 0x000000000389cc96 SignalHandler(int) (/path/to/swift/bin/swift+0x389cc96) 2 0x00007ff75781e3e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0) 3 0x00007ff756184428 gsignal /build/glibc-Qz8a69/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0 4 0x00007ff75618602a abort /build/glibc-Qz8a69/glibc-2.23/stdlib/abort.c:91:0 5 0x00007ff75617cbd7 __assert_fail_base /build/glibc-Qz8a69/glibc-2.23/assert/assert.c:92:0 6 0x00007ff75617cc82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82) 7 0x0000000001241e09 (/path/to/swift/bin/swift+0x1241e09) 8 0x00000000012435cf swift::constraints::ConstraintGraph::addConstraint(swift::constraints::Constraint*) (/path/to/swift/bin/swift+0x12435cf) 9 0x0000000001215ff9 swift::constraints::ConstraintSystem::addUnsolvedConstraint(swift::constraints::Constraint*) (/path/to/swift/bin/swift+0x1215ff9) 10 0x0000000001211420 swift::constraints::ConstraintSystem::matchTypes(swift::Type, swift::Type, swift::constraints::ConstraintKind, swift::OptionSet<swift::constraints::ConstraintSystem::TypeMatchFlags, unsigned int>, swift::constraints::ConstraintLocatorBuilder) (/path/to/swift/bin/swift+0x1211420) 11 0x000000000121e4c8 swift::constraints::ConstraintSystem::addConstraintImpl(swift::constraints::ConstraintKind, swift::Type, swift::Type, swift::constraints::ConstraintLocatorBuilder, bool) (/path/to/swift/bin/swift+0x121e4c8) 12 0x000000000121641e swift::constraints::ConstraintSystem::addConstraint(swift::constraints::ConstraintKind, swift::Type, swift::Type, swift::constraints::ConstraintLocatorBuilder, bool) (/path/to/swift/bin/swift+0x121641e) 13 0x0000000001250b7d swift::constraints::ConstraintSystem::getTypeOfReference(swift::ValueDecl*, bool, bool, swift::FunctionRefKind, swift::constraints::ConstraintLocatorBuilder, swift::DeclRefExpr const*) (/path/to/swift/bin/swift+0x1250b7d) 14 0x000000000125344e swift::constraints::ConstraintSystem::resolveOverload(swift::constraints::ConstraintLocator*, swift::Type, swift::constraints::OverloadChoice) (/path/to/swift/bin/swift+0x125344e) 15 0x00000000012f86c8 swift::ASTVisitor<(anonymous namespace)::ConstraintGenerator, swift::Type, void, void, void, void, void>::visit(swift::Expr*) (/path/to/swift/bin/swift+0x12f86c8) 16 0x00000000012fccc8 (anonymous namespace)::ConstraintWalker::walkToExprPost(swift::Expr*) (/path/to/swift/bin/swift+0x12fccc8) 17 0x00000000013a6937 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) (/path/to/swift/bin/swift+0x13a6937) 18 0x00000000013a52cb swift::Expr::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0x13a52cb) 19 0x00000000012f4aa8 swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*) (/path/to/swift/bin/swift+0x12f4aa8) 20 0x0000000001226afd swift::constraints::ConstraintSystem::solve(swift::Expr*&, swift::Type, swift::ExprTypeCheckListener*, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) (/path/to/swift/bin/swift+0x1226afd) 21 0x0000000001281b64 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>) (/path/to/swift/bin/swift+0x1281b64) 22 0x0000000001285706 swift::TypeChecker::getTypeOfExpressionWithoutApplying(swift::Expr*&, swift::DeclContext*, swift::ConcreteDeclRef&, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*) (/path/to/swift/bin/swift+0x1285706) 23 0x00000000012005b3 (anonymous namespace)::FailureDiagnosis::diagnoseAmbiguousMultiStatementClosure(swift::ClosureExpr*) (/path/to/swift/bin/swift+0x12005b3) 24 0x00000000012058f1 std::_Function_handler<swift::Expr* (swift::Expr*), (anonymous namespace)::FailureDiagnosis::diagnoseAmbiguity(swift::Expr*)::$_18>::_M_invoke(std::_Any_data const&, swift::Expr*&&) (/path/to/swift/bin/swift+0x12058f1) 25 0x00000000013e6107 swift::Expr::forEachChildExpr(std::function<swift::Expr* (swift::Expr*)> const&)::ChildWalker::walkToExprPre(swift::Expr*) (/path/to/swift/bin/swift+0x13e6107) 26 0x00000000013a5ec6 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) (/path/to/swift/bin/swift+0x13a5ec6) 27 0x00000000013a85be (anonymous namespace)::Traversal::visitApplyExpr(swift::ApplyExpr*) (/path/to/swift/bin/swift+0x13a85be) 28 0x00000000013a65a2 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) (/path/to/swift/bin/swift+0x13a65a2) 29 0x00000000013a85be (anonymous namespace)::Traversal::visitApplyExpr(swift::ApplyExpr*) (/path/to/swift/bin/swift+0x13a85be) 30 0x00000000013a5ef8 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) (/path/to/swift/bin/swift+0x13a5ef8) 31 0x00000000013a52cb swift::Expr::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0x13a52cb) 32 0x00000000013decc8 swift::Expr::forEachChildExpr(std::function<swift::Expr* (swift::Expr*)> const&) (/path/to/swift/bin/swift+0x13decc8) 33 0x00000000011dea72 (anonymous namespace)::FailureDiagnosis::diagnoseAmbiguity(swift::Expr*) (/path/to/swift/bin/swift+0x11dea72) 34 0x00000000011d92c7 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) (/path/to/swift/bin/swift+0x11d92c7) 35 0x00000000011dffcd swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) (/path/to/swift/bin/swift+0x11dffcd) 36 0x0000000001281ba8 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>) (/path/to/swift/bin/swift+0x1281ba8) 37 0x00000000012851d6 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) (/path/to/swift/bin/swift+0x12851d6) 38 0x000000000119bb7e swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0x119bb7e) 39 0x000000000119b3a6 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) (/path/to/swift/bin/swift+0x119b3a6) 40 0x00000000011b1220 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/path/to/swift/bin/swift+0x11b1220) 41 0x0000000000f0b896 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0xf0b896) 42 0x00000000004a4606 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x4a4606) 43 0x00000000004638c7 main (/path/to/swift/bin/swift+0x4638c7) 44 0x00007ff75616f830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0 45 0x0000000000460f69 _start (/path/to/swift/bin/swift+0x460f69) ```
Contributor
Author
|
@swift-ci please test and merge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add test case for crash triggered in
swift::constraints::ConstraintGraph::addConstraint(...).Current number of unresolved compiler crashers: 42 (5433 resolved)
/cc @DougGregor - just wanted to let you know that this crasher caused an assertion failure for the assertion
impl.getGraphIndex() < TypeVariables.size() && "Out-of-bounds index"added on 2013-12-09 by you in commit 1179409 :-)Assertion failure in
lib/Sema/ConstraintGraph.cpp (line 50):Assertion context:
Stack trace: