-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[swiftc (25 vs. 5511)] Add crasher in swift::TypeBase::getContextSubstitutions #8410
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
[swiftc (25 vs. 5511)] Add crasher in swift::TypeBase::getContextSubstitutions #8410
Conversation
@swift-ci please test and merge |
…titutions Add test case for crash triggered in `swift::TypeBase::getContextSubstitutions`. Current number of unresolved compiler crashers: 25 (5511 resolved) Stack trace: ``` 0 0x000000000395df08 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x395df08) 1 0x000000000395e646 SignalHandler(int) (/path/to/swift/bin/swift+0x395e646) 2 0x00007f43e1b53390 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x11390) 3 0x00007f43e0079428 gsignal /build/glibc-9tT8Do/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0 4 0x00007f43e007b02a abort /build/glibc-9tT8Do/glibc-2.23/stdlib/abort.c:91:0 5 0x00000000038fa2dd llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) (/path/to/swift/bin/swift+0x38fa2dd) 6 0x00000000014f5458 swift::TypeBase::getContextSubstitutions(swift::DeclContext const*, swift::GenericEnvironment*) (/path/to/swift/bin/swift+0x14f5458) 7 0x00000000014f0f00 swift::TypeBase::getContextSubstitutionMap(swift::ModuleDecl*, swift::DeclContext const*, swift::GenericEnvironment*) (/path/to/swift/bin/swift+0x14f0f00) 8 0x00000000013158eb swift::TypeChecker::substMemberTypeWithBase(swift::ModuleDecl*, swift::TypeDecl*, swift::Type) (/path/to/swift/bin/swift+0x13158eb) 9 0x00000000012d961d swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) (/path/to/swift/bin/swift+0x12d961d) 10 0x00000000013174bc 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+0x13174bc) 11 0x0000000001316cb3 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+0x1316cb3) 12 0x0000000001317dc7 (anonymous namespace)::TypeResolver::resolveType(swift::TypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>) (/path/to/swift/bin/swift+0x1317dc7) 13 0x0000000001317ccc 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+0x1317ccc) 14 0x00000000013163ca 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+0x13163ca) 15 0x00000000012dc85a swift::TypeChecker::typeCheckPattern(swift::Pattern*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>) (/path/to/swift/bin/swift+0x12dc85a) 16 0x00000000012ac2fc validatePatternBindingEntries(swift::TypeChecker&, swift::PatternBindingDecl*) (/path/to/swift/bin/swift+0x12ac2fc) 17 0x00000000012a6824 (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0x12a6824) 18 0x00000000012a66e3 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) (/path/to/swift/bin/swift+0x12a66e3) 19 0x0000000001310516 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0x1310516) 20 0x000000000130fd86 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) (/path/to/swift/bin/swift+0x130fd86) 21 0x0000000001324890 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/path/to/swift/bin/swift+0x1324890) 22 0x0000000000f950f6 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0xf950f6) 23 0x00000000004a7d6b swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x4a7d6b) 24 0x00000000004650b7 main (/path/to/swift/bin/swift+0x4650b7) 25 0x00007f43e0064830 __libc_start_main /build/glibc-9tT8Do/glibc-2.23/csu/../csu/libc-start.c:325:0 26 0x0000000000462759 _start (/path/to/swift/bin/swift+0x462759) ```
@swift-ci please test and merge |
@slavapestov Is this one as simple as teaching |
@CodaFi I think I already have a WIP fix for this: #8338 (it's not rebased so only the last patch is relevant). It might not address the exact issue but I'm pretty sure it's in the same area. The patch needs tests and also a fix for a small source compat break in 3 mode. I'll finish it off soon and do another sweep of the generics crashers. :-) |
@slavapestov Great! 💯 Only 25 crashers left and the rate of crasher discovery is currently very low! :-) |
Add test case for crash triggered in
swift::TypeBase::getContextSubstitutions
.Current number of unresolved compiler crashers: 25 (5511 resolved)
Stack trace: