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-9017] Compiler crash in swift::BoundGenericType::get(swift::NominalTypeDecl*, swift::Type, llvm::ArrayRef<swift::Type>) #51520

Closed
nathawes opened this issue Oct 16, 2018 · 2 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 type checker Area → compiler: Semantic analysis

Comments

@nathawes
Copy link
Collaborator

Previous ID SR-9017
Radar rdar://problem/45317855
Original Reporter @nathawes
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, TypeChecker
Assignee @slavapestov
Priority Medium

md5: 2f60cf5848cf4c841b7401d6e04c3303

Issue Description:

public final class Action<Input, Error: Swift.Error> {

extension Action {

public enum ActionError<Error: Swift.Error>: Swift.Error {
  case disabled
/tmp/test.swift:6:16: error: expected '}' at end of enum
  case disabled
               ^
/tmp/test.swift:5:58: note: to match this opening '{'
public enum ActionError<Error: Swift.Error>: Swift.Error {
                                                         ^
/tmp/test.swift:6:16: error: expected '}' at end of extension
  case disabled
               ^
/tmp/test.swift:3:18: note: to match this opening '{'
extension Action {
                 ^
/tmp/test.swift:3:1: error: declaration is only valid at file scope
extension Action {
^
/tmp/test.swift:6:16: error: expected '}' in class
  case disabled
               ^
/tmp/test.swift:1:54: note: to match this opening '{'
public final class Action<Input, Error: Swift.Error> {
                                                     ^
/tmp/test.swift:3:1: error: constrained extension must be declared on the unspecialized generic type 'Action' with constraints specified by a 'where' clause
extension Action {
^         ~~~~~~
Stack dump:
0.  Program arguments: /Users/nathanhawes/workspace/open-swift-source-compat-suite-master/build/compat_macos/swift-macosx-x86_64/bin/swift -frontend -c -primary-file /tmp/test.swift -target x86_64-apple-darwin18.0.0 -enable-objc-interop -color-diagnostics -module-name test -o /var/folders/jn/jqt21vpn01d0m1k3ygry46hh0000gn/T/test-39ecac.o 
0  swift                    0x00000001125c0a18 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swift                    0x00000001125bfbb8 llvm::sys::RunSignalHandlers() + 248
2  swift                    0x00000001125c1032 SignalHandler(int) + 258
3  libsystem_platform.dylib 0x00007fff744e6b3d _sigtramp + 29
4  libsystem_platform.dylib 0x0000000000000088 _sigtramp + 2343671144
5  swift                    0x00000001100ab13a swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 1082
6  swift                    0x00000001100aae9b swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 411
7  swift                    0x00000001100ab449 swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 1865
8  swift                    0x00000001100a12f8 swift::Type::transform(llvm::function_ref<swift::Type (swift::Type)>) const + 40
9  swift                    0x000000010fd11eea swift::constraints::ConstraintSystem::openFunctionType(swift::AnyFunctionType*, unsigned int, swift::constraints::ConstraintLocatorBuilder, llvm::DenseMap<swift::GenericTypeParamType*, swift::TypeVariableType*, llvm::DenseMapInfo<swift::GenericTypeParamType*>, llvm::detail::DenseMapPair<swift::GenericTypeParamType*, swift::TypeVariableType*> >&, swift::DeclContext*, swift::DeclContext*, bool) + 362
10 swift                    0x000000010fd139a5 swift::constraints::ConstraintSystem::getTypeOfMemberReference(swift::Type, swift::ValueDecl*, swift::DeclContext*, bool, swift::FunctionRefKind, swift::constraints::ConstraintLocatorBuilder, swift::DeclRefExpr const*, llvm::DenseMap<swift::GenericTypeParamType*, swift::TypeVariableType*, llvm::DenseMapInfo<swift::GenericTypeParamType*>, llvm::detail::DenseMapPair<swift::GenericTypeParamType*, swift::TypeVariableType*> >*) + 1701
11 swift                    0x000000010fdba0a3 std::__1::tuple<llvm::Optional<swift::RequirementMatch>, swift::Type, swift::Type> llvm::function_ref<std::__1::tuple<llvm::Optional<swift::RequirementMatch>, swift::Type, swift::Type> ()>::callback_fn<swift::matchWitness(swift::TypeChecker&, llvm::DenseMap<std::__1::pair<swift::GenericSignature const*, swift::ClassDecl const*>, swift::RequirementEnvironment, llvm::DenseMapInfo<std::__1::pair<swift::GenericSignature const*, swift::ClassDecl const*> >, llvm::detail::DenseMapPair<std::__1::pair<swift::GenericSignature const*, swift::ClassDecl const*>, swift::RequirementEnvironment> >&, swift::ProtocolDecl*, swift::ProtocolConformance*, swift::DeclContext*, swift::ValueDecl*, swift::ValueDecl*)::$_0>(long) + 1171
12 swift                    0x000000010fda7552 swift::matchWitness(swift::TypeChecker&, swift::DeclContext*, swift::ValueDecl*, swift::ValueDecl*, llvm::function_ref<std::__1::tuple<llvm::Optional<swift::RequirementMatch>, swift::Type, swift::Type> ()>, llvm::function_ref<llvm::Optional<swift::RequirementMatch> (swift::Type, swift::Type)>, llvm::function_ref<swift::RequirementMatch (bool, llvm::ArrayRef<swift::OptionalAdjustment>)>) + 2306
13 swift                    0x000000010fda8cf9 swift::matchWitness(swift::TypeChecker&, llvm::DenseMap<std::__1::pair<swift::GenericSignature const*, swift::ClassDecl const*>, swift::RequirementEnvironment, llvm::DenseMapInfo<std::__1::pair<swift::GenericSignature const*, swift::ClassDecl const*> >, llvm::detail::DenseMapPair<std::__1::pair<swift::GenericSignature const*, swift::ClassDecl const*>, swift::RequirementEnvironment> >&, swift::ProtocolDecl*, swift::ProtocolConformance*, swift::DeclContext*, swift::ValueDecl*, swift::ValueDecl*) + 1017
14 swift                    0x000000010fdb09a4 swift::ConformanceChecker::resolveWitnessViaDerivation(swift::ValueDecl*) + 180
15 swift                    0x000000010fdad31e swift::ConformanceChecker::checkConformance(swift::MissingWitnessDiagnosisKind) + 686
16 swift                    0x000000010fdabf89 swift::MultiConformanceChecker::checkIndividualConformance(swift::NormalProtocolConformance*, bool) + 6089
17 swift                    0x000000010fdaa66f swift::MultiConformanceChecker::checkAllConformances() + 111
18 swift                    0x000000010fdb3cd0 swift::TypeChecker::checkConformancesInContext(swift::DeclContext*, swift::IterableDeclContext*) + 2912
19 swift                    0x000000010fdf2c62 typeCheckFunctionsAndExternalDecls(swift::SourceFile&, swift::TypeChecker&) + 178
20 swift                    0x000000010fdf3b98 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) + 1944
21 swift                    0x000000010fb19a94 swift::CompilerInstance::parseAndTypeCheckMainFileUpTo(swift::SourceFile::ASTStage_t, swift::PersistentParserState&, swift::DelayedParsingCallbacks*, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>) + 420
22 swift                    0x000000010fb18963 swift::CompilerInstance::parseAndCheckTypesUpTo(swift::CompilerInstance::ImplicitImports const&, swift::SourceFile::ASTStage_t) + 435
23 swift                    0x000000010fb182df swift::CompilerInstance::performSemaUpTo(swift::SourceFile::ASTStage_t) + 511
24 swift                    0x000000010f00c9e5 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 1445
25 swift                    0x000000010f00b524 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3028
26 swift                    0x000000010efc4a34 main + 660
27 libdyld.dylib            0x00007fff742fd085 start + 1
28 libdyld.dylib            0x000000000000000d start + 2345676681
<unknown>:0: error: unable to execute command: Segmentation fault: 11
<unknown>:0: error: compile command failed due to signal 11 (use -v to see invocation)
@nathawes
Copy link
Collaborator Author

@swift-ci create

@slavapestov
Copy link
Member

#21245

@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

3 participants