Skip to content
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

[SR-8642] Crash on invalid involving class with inherited conformance #51157

Closed
rjmccall opened this issue Aug 25, 2018 · 3 comments
Closed

[SR-8642] Crash on invalid involving class with inherited conformance #51157

rjmccall opened this issue Aug 25, 2018 · 3 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software

Comments

@rjmccall
Copy link
Member

Previous ID SR-8642
Radar None
Original Reporter @rjmccall
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash
Assignee @DougGregor
Priority Medium

md5: a68665adee6a046c2867d9da5ccc9759

Issue Description:

protocol P {}
protocol Q {}

class A : P {}
class B : A {}

struct A<T:B> {
var x: T { fatalError("death") }
}

@slavapestov
Copy link
Member

Doug, this might be you:

Assertion failed: (Storage.hasVal), function getPointer, file /Users/spestov/src/llvm/include/llvm/ADT/Optional.h, line 176.
Stack dump:
0.  Program arguments: /Users/spestov/src/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/bin/swift -frontend -c -primary-file a.swift -target x86_64-apple-darwin17.5.0 -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -color-diagnostics -module-name a -o /var/folders/l8/g2xc3hcd1bg16y2sjntf2j900000gp/T/a-04d7e4.o 
1.  While type-checking 'B' at a.swift:4:1
0  swift                    0x00000001078257a8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swift                    0x0000000107824a25 llvm::sys::RunSignalHandlers() + 85
2  swift                    0x0000000107825db2 SignalHandler(int) + 258
3  libsystem_platform.dylib 0x00007fff52f57f5a _sigtramp + 26
4  swift                    0x0000000108af3ba0 cmark_strbuf__initbuf + 123123
5  libsystem_c.dylib        0x00007fff52cf51ae abort + 127
6  libsystem_c.dylib        0x00007fff52cbd1ac basename_r + 0
7  swift                    0x0000000104f91642 swift::ConformanceLookupTable::getConformance(swift::NominalTypeDecl*, swift::ConformanceLookupTable::ConformanceEntry*) + 1026
8  swift                    0x0000000104f9234f swift::ConformanceLookupTable::getAllConformances(swift::NominalTypeDecl*, bool, llvm::SmallVectorImpl<swift::ProtocolConformance*>&) + 143
9  swift                    0x00000001050572e3 swift::NominalTypeDecl::getAllConformances(bool) const + 67
10 swift                    0x0000000104c95397 (anonymous namespace)::DeclChecker::visitClassDecl(swift::ClassDecl*) + 3975
11 swift                    0x0000000104c87b7b (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 827
12 swift                    0x0000000104c87836 swift::TypeChecker::typeCheckDecl(swift::Decl*) + 38
13 swift                    0x0000000104d1cda9 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) + 2057
14 swift                    0x000000010496fcf8 swift::CompilerInstance::parseAndTypeCheckMainFileUpTo(swift::SourceFile::ASTStage_t, swift::PersistentParserState&, swift::DelayedParsingCallbacks*, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>) + 472
15 swift                    0x000000010496e93b swift::CompilerInstance::parseAndCheckTypesUpTo(swift::CompilerInstance::ImplicitImports const&, swift::SourceFile::ASTStage_t) + 667
16 swift                    0x000000010496de33 swift::CompilerInstance::performSemaUpTo(swift::SourceFile::ASTStage_t) + 627
17 swift                    0x0000000103d5c43e performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 1326
18 swift                    0x0000000103d5aeb4 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2932
19 swift                    0x0000000103d0fc7d main + 685
20 libdyld.dylib            0x00007fff52c49015 start + 1

@DougGregor
Copy link
Member

#19021

1 similar comment
@DougGregor
Copy link
Member

#19021

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software
Projects
None yet
Development

No branches or pull requests

4 participants