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-8160] Compiler crash on "class C1 : Any, C" #50692

Closed
hamishknight opened this issue Jul 1, 2018 · 1 comment
Closed

[SR-8160] Compiler crash on "class C1 : Any, C" #50692

hamishknight opened this issue Jul 1, 2018 · 1 comment
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 type checker Area → compiler: Semantic analysis

Comments

@hamishknight
Copy link
Collaborator

Previous ID SR-8160
Radar None
Original Reporter @hamishknight
Type Bug
Status Closed
Resolution Done
Environment

Swift version 4.2-dev (LLVM d6832022e4, Clang b531f0b345, Swift ff17676)
Target: x86_64-apple-darwin17.6.0

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, TypeChecker
Assignee @hamishknight
Priority Medium

md5: 6d8b0ae2134cbf13a23fdeb9e477a2e2

Issue Description:

The following crashes the compiler:

class C {}
class C1 : Any, C {}

Output:

/Users/Hamish/Desktop/main.swift:10:17: error: superclass 'C' must appear first in the inheritance clause
class C1 : Any, C {}
              ~~^
           C,
0  swift                    0x0000000111fc8298 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swift                    0x0000000111fc7507 llvm::sys::RunSignalHandlers() + 39
2  swift                    0x0000000111fc8912 SignalHandler(int) + 258
3  libsystem_platform.dylib 0x00007fff59804f5a _sigtramp + 26
4  libsystem_platform.dylib 0x0000000000000020 _sigtramp + 2793386208
5  swift                    0x000000010f528059 swift::TypeBase::getCanonicalType() const + 25
6  swift                    0x000000010f5377f5 swift::TypeBase::getAnyNominal() + 21
7  swift                    0x000000010edeab72 swift::AccessControlChecker::check(swift::Decl*)::$_11::operator()(swift::TypeLoc) const + 146
8  swift                    0x000000010edded4a swift::AccessControlChecker::check(swift::Decl*) + 3258
9  swift                    0x000000010eea69ed swift::AccessControlChecker::checkAccessControl(swift::TypeChecker&, swift::Decl*) + 45
10 swift                    0x000000010eea2a23 (anonymous namespace)::DeclChecker::visitClassDecl(swift::ClassDecl*) + 2979
11 swift                    0x000000010ee9feee swift::ASTVisitor<(anonymous namespace)::DeclChecker, void, void, void, void, void, void>::visit(swift::Decl*) + 302
12 swift                    0x000000010ee7de5f (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 303
13 swift                    0x000000010ee7dcf9 swift::TypeChecker::typeCheckDecl(swift::Decl*) + 73
14 swift                    0x000000010f01d69a swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) + 1274
15 swift                    0x000000010e5efc32 swift::CompilerInstance::parseAndTypeCheckMainFile(swift::PersistentParserState&, swift::DelayedParsingCallbacks*, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>) + 1010
16 swift                    0x000000010e5eb858 swift::CompilerInstance::parseAndCheckTypes(swift::CompilerInstance::ImplicitImports const&) + 776
17 swift                    0x000000010e5eaf9f swift::CompilerInstance::performSema() + 1903
18 swift                    0x000000010d2ed8f1 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 369
19 swift                    0x000000010d2eb90c swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 5020
20 swift                    0x000000010d20e5c5 run_driver(llvm::StringRef, llvm::ArrayRef<char const*>) + 917
21 swift                    0x000000010d20ced1 main + 4721
22 libdyld.dylib            0x00007fff594f6015 start + 1
Stack dump:
0.  Program arguments: /Users/Hamish/Desktop/swift-dev/build/Ninja-RelWithDebInfoAssert+swift-DebugAssert/swift-macosx-x86_64/bin/swift -frontend -c -primary-file /Users/Hamish/Desktop/main.swift -target x86_64-apple-darwin17.6.0 -enable-objc-interop -color-diagnostics -module-name null -o /var/folders/2s/m9mqt6bx6bsbfzt64whnsf080000gp/T/main-560e65.o
1.  While type-checking 'C1' at /Users/Hamish/Desktop/main.swift:10:1
<unknown>:0: error: unable to execute command: Segmentation fault: 11
@hamishknight
Copy link
Collaborator Author

#17662

@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 type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants