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-9045] Crash in RequirementFailure::diagnoseAsNote() #51548

Closed
nathawes opened this issue Oct 19, 2018 · 3 comments
Closed

[SR-9045] Crash in RequirementFailure::diagnoseAsNote() #51548

nathawes opened this issue Oct 19, 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

@nathawes
Copy link
Collaborator

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

md5: 41a496ade1752db1e771df4ccf0c8516

Issue Description:

To reproduce:

extension BinaryInteger {
  init(bytes: [UInt8]) { fatalError() }

  init<S: Sequence>(bytes: S) where S.Iterator.Element == UInt8 {
    self.init(bytes

extension
} 
Application Specific Information:
Stack dump:
0.  Program arguments: /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2018-10-03-a.xctoolchain/usr/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-19ece3.o 
1.  While type-checking 'init(bytes:)' at /tmp/test.swift:4:3
2.  While type-checking statement at [/tmp/test.swift:4:65 - line:8:1] RangeText="{
    self.init(bytes
 
extension
"
3.  While type-checking expression at [/tmp/test.swift:5:5 - line:5:15] RangeText="self.init("
 

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   swift                           0x000000010a12c04d swift::constraints::RequirementFailure::getRequirement() const + 13
1   swift                           0x000000010a12c859 swift::constraints::RequirementFailure::diagnoseAsNote() + 25
2   swift                           0x000000010a12b573 swift::constraints::MissingConformance::diagnose(swift::Expr*, bool) const + 195
3   swift                           0x000000010a15f0ef swift::constraints::ConstraintSystem::diagnoseAmbiguityWithFixes(swift::Expr*, llvm::ArrayRef<swift::constraints::Solution>) + 927
4   swift                           0x000000010a15e93a swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 346
5   swift                           0x000000010a11b3e8 swift::constraints::ConstraintSystem::solve(swift::Expr*&, swift::Type, swift::ExprTypeCheckListener*, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 72
6   swift                           0x000000010a1b9e37 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 951
7   swift                           0x000000010a2472c8 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) + 584
8   swift                           0x000000010a246578 bool (anonymous namespace)::StmtChecker::typeCheckStmt<swift::BraceStmt>(swift::BraceStmt*&) + 136
9   swift                           0x000000010a245511 swift::TypeChecker::typeCheckConstructorBodyUntil(swift::ConstructorDecl*, swift::SourceLoc) + 721
10  swift                           0x000000010a245c4f swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 271
11  swift                           0x000000010a266133 typeCheckFunctionsAndExternalDecls(swift::SourceFile&, swift::TypeChecker&) + 339
12  swift                           0x000000010a26728d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) + 2061
13  swift                           0x0000000109f09d28 swift::CompilerInstance::parseAndTypeCheckMainFileUpTo(swift::SourceFile::ASTStage_t, swift::PersistentParserState&, swift::DelayedParsingCallbacks*, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>) + 472
14  swift                           0x0000000109f08973 swift::CompilerInstance::parseAndCheckTypesUpTo(swift::CompilerInstance::ImplicitImports const&, swift::SourceFile::ASTStage_t) + 435
15  swift                           0x0000000109f08038 swift::CompilerInstance::performSemaUpTo(swift::SourceFile::ASTStage_t) + 616
16  swift                           0x0000000109242067 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 1335
17  swift                           0x0000000109240a9d swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3021
18  swift                           0x00000001091f2f0e main + 686
19  libdyld.dylib                   0x00007fff742fd085 start + 1
@nathawes
Copy link
Collaborator Author

@swift-ci create

1 similar comment
@nathawes
Copy link
Collaborator Author

@swift-ci create

@xedin
Copy link
Member

xedin commented Oct 23, 2018

Should be fixed by #19990

@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

3 participants