-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[swiftc (23 vs. 5389)] Add crasher in swift::TypeChecker::resolveTypeInContext #6558
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
practicalswift
merged 1 commit into
swiftlang:master
from
practicalswift:swiftc-28599-false-should-have-found-context-by-now
Jan 4, 2017
Merged
[swiftc (23 vs. 5389)] Add crasher in swift::TypeChecker::resolveTypeInContext #6558
practicalswift
merged 1 commit into
swiftlang:master
from
practicalswift:swiftc-28599-false-should-have-found-context-by-now
Jan 4, 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
…InContext Add test case for crash triggered in `swift::TypeChecker::resolveTypeInContext`. Current number of unresolved compiler crashers: 23 (5389 resolved) /cc @slavapestov - just wanted to let you know that this crasher caused an assertion failure for the assertion `false && "Should have found context by now"` added on 2016-12-06 by you in commit fdaa886 :-) Assertion failure in [`lib/Sema/TypeCheckType.cpp (line 325)`](https://github.com/apple/swift/blob/master/lib/Sema/TypeCheckType.cpp#L325): ``` Assertion `false && "Should have found context by now"' failed. When executing: std::tuple<DeclContext *, NominalTypeDecl *, bool> findDeclContextForType(swift::TypeChecker &, swift::TypeDecl *, swift::DeclContext *, TypeResolutionOptions) ``` Assertion context: ``` // or associated type from a context outside a ProtocolDecl. if (isa<ProtocolDecl>(parentDC) && isa<AbstractTypeParamDecl>(typeDecl)) return std::make_tuple(nullptr, nullptr, false); } assert(false && "Should have found context by now"); return std::make_tuple(nullptr, nullptr, false); } Type TypeChecker::resolveTypeInContext( TypeDecl *typeDecl, ``` Stack trace: ``` 0 0x0000000003512118 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x3512118) 1 0x0000000003512856 SignalHandler(int) (/path/to/swift/bin/swift+0x3512856) 2 0x00007fa33d95b3e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0) 3 0x00007fa33c089428 gsignal /build/glibc-Qz8a69/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0 4 0x00007fa33c08b02a abort /build/glibc-Qz8a69/glibc-2.23/stdlib/abort.c:91:0 5 0x00007fa33c081bd7 __assert_fail_base /build/glibc-Qz8a69/glibc-2.23/assert/assert.c:92:0 6 0x00007fa33c081c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82) 7 0x0000000000c11d39 swift::TypeChecker::resolveTypeInContext(swift::TypeDecl*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*) (/path/to/swift/bin/swift+0xc11d39) 8 0x0000000000c19498 resolveTypeDecl(swift::TypeChecker&, swift::TypeDecl*, swift::SourceLoc, swift::DeclContext*, swift::GenericIdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0xc19498) 9 0x0000000000c1909d resolveTopLevelIdentTypeComponent(swift::TypeChecker&, swift::DeclContext*, swift::ComponentIdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0xc1909d) 10 0x0000000000c138f9 resolveIdentTypeComponent(swift::TypeChecker&, swift::DeclContext*, llvm::ArrayRef<swift::ComponentIdentTypeRepr*>, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0xc138f9) 11 0x0000000000c13323 swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0xc13323) 12 0x0000000000c14357 (anonymous namespace)::TypeResolver::resolveType(swift::TypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>) (/path/to/swift/bin/swift+0xc14357) 13 0x0000000000c1425c swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0xc1425c) 14 0x0000000000c129fa swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0xc129fa) 15 0x0000000000d37249 validateParameterType(swift::ParamDecl*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver&, swift::TypeChecker&) (/path/to/swift/bin/swift+0xd37249) 16 0x0000000000d370f9 swift::TypeChecker::typeCheckParameterList(swift::ParameterList*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver&) (/path/to/swift/bin/swift+0xd370f9) 17 0x0000000000d30eea checkGenericFuncSignature(swift::TypeChecker&, swift::ArchetypeBuilder*, swift::AbstractFunctionDecl*, swift::GenericTypeResolver&) (/path/to/swift/bin/swift+0xd30eea) 18 0x0000000000d3024e swift::TypeChecker::validateGenericFuncSignature(swift::AbstractFunctionDecl*) (/path/to/swift/bin/swift+0xd3024e) 19 0x0000000000d1aceb (anonymous namespace)::DeclChecker::visitFuncDecl(swift::FuncDecl*) (/path/to/swift/bin/swift+0xd1aceb) 20 0x0000000000d0a720 (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0xd0a720) 21 0x0000000000d178fb (anonymous namespace)::DeclChecker::visitClassDecl(swift::ClassDecl*) (/path/to/swift/bin/swift+0xd178fb) 22 0x0000000000d0a5b4 (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0xd0a5b4) 23 0x0000000000d1874b (anonymous namespace)::DeclChecker::visitProtocolDecl(swift::ProtocolDecl*) (/path/to/swift/bin/swift+0xd1874b) 24 0x0000000000d0a700 (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0xd0a700) 25 0x0000000000d0a4e3 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) (/path/to/swift/bin/swift+0xd0a4e3) 26 0x0000000000c21bf5 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/path/to/swift/bin/swift+0xc21bf5) 27 0x0000000000996736 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0x996736) 28 0x000000000047c5aa swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47c5aa) 29 0x000000000043ade7 main (/path/to/swift/bin/swift+0x43ade7) 30 0x00007fa33c074830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0 31 0x0000000000438229 _start (/path/to/swift/bin/swift+0x438229) ```
@swift-ci please smoke test and merge |
@swift-ci please test and merge |
@swift-ci please smoke test linux platform |
@swift-ci please test linux platform |
@swift-ci please smoke test linux platform |
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::TypeChecker::resolveTypeInContext
.Current number of unresolved compiler crashers: 23 (5389 resolved)
/cc @slavapestov - just wanted to let you know that this crasher caused an assertion failure for the assertion
false && "Should have found context by now"
added on 2016-12-06 by you in commit fdaa886 :-)Assertion failure in
lib/Sema/TypeCheckType.cpp (line 325)
:Assertion context:
Stack trace: