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-12490] Assertion failed: ((bs->empty()) && "Might mess up insertion point" " Try compiling with '-disable-astscope-lookup'.") #54932

Closed
nathawes opened this issue Apr 2, 2020 · 2 comments
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 found by stress tester Flag: An issue found by the SourceKit stress tester

Comments

@nathawes
Copy link
Collaborator

nathawes commented Apr 2, 2020

Previous ID SR-12490
Radar rdar://problem/61461187
Original Reporter @nathawes
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s
Labels Bug, Crash, FoundByStressTester
Assignee None
Priority Medium

md5: 99e4e15cf2261b112bc4be7f91a4b9ce

Issue Description:

To reproduce, compile the below incomplete code with the March 31st dev snapshot compiler:

public struct Foo {
    func bar() {
        var copySelf = self
        repeat { copySelf

private extension String {}

Trace:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff6bffe7fa __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff6c0bbbc1 pthread_kill + 432
2   libsystem_c.dylib               0x00007fff6bf85ab6 __abort + 139
3   libsystem_c.dylib               0x00007fff6bf85a2b abort + 135
4   libsystem_c.dylib               0x00007fff6bf84cd6 __assert_rtn + 314
5   swift                           0x00000001118e3f73 swift::ast_scope::ScopeCreator::shouldThisNodeBeScopedWhenFoundInSourceFileBraceStmtOrType(swift::ASTNode) (.cold.2) + 35
6   swift                           0x000000010e2565cf swift::ast_scope::ScopeCreator::shouldThisNodeBeScopedWhenFoundInSourceFileBraceStmtOrType(swift::ASTNode) + 95
7   swift                           0x000000010e2524d2 swift::ast_scope::ScopeCreator::addSiblingsToScopeTree(swift::ast_scope::ASTScopeImpl*, swift::ast_scope::ASTScopeImpl*, llvm::ArrayRef<swift::ASTNode>) + 130
8   swift                           0x000000010e251494 swift::ast_scope::BraceStmtScope::expandSpecifically(swift::ast_scope::ScopeCreator&) + 36
9   swift                           0x000000010e250de6 swift::ast_scope::ASTScopeImpl::expandAndBeCurrent(swift::ast_scope::ScopeCreator&) + 150
10  swift                           0x000000010e250d3f swift::ExpandASTScopeRequest::evaluate(swift::Evaluator&, swift::ast_scope::ASTScopeImpl*, swift::ast_scope::ScopeCreator*) const + 15
11  swift                           0x000000010e2602a5 llvm::Expected<swift::ExpandASTScopeRequest::OutputType> swift::Evaluator::getResultUncached<swift::ExpandASTScopeRequest>(swift::ExpandASTScopeRequest const&) + 469
12  swift                           0x000000010e250c2e swift::ExpandASTScopeRequest::OutputType swift::evaluateOrDefault<swift::ExpandASTScopeRequest>(swift::Evaluator&, swift::ExpandASTScopeRequest, swift::ExpandASTScopeRequest::OutputType) + 94
13  swift                           0x000000010e25cfdd swift::ast_scope::ASTScopeImpl* swift::ast_scope::ScopeCreator::constructExpandAndInsert<swift::ast_scope::BraceStmtScope, swift::BraceStmt*>(swift::ast_scope::ASTScopeImpl*, swift::BraceStmt*) + 173
14  swift                           0x000000010e25cee1 swift::NullablePtr<swift::ast_scope::ASTScopeImpl> swift::ast_scope::ScopeCreator::ifUniqueConstructExpandAndInsert<swift::ast_scope::BraceStmtScope, swift::BraceStmt*>(swift::ast_scope::ASTScopeImpl*, swift::BraceStmt*) + 193
15  swift                           0x000000010e250209 swift::ASTVisitor<swift::ast_scope::NodeAdder, swift::NullablePtr<swift::ast_scope::ASTScopeImpl>, swift::NullablePtr<swift::ast_scope::ASTScopeImpl>, swift::NullablePtr<swift::ast_scope::ASTScopeImpl>, void, void, void, swift::ast_scope::ASTScopeImpl*, swift::ast_scope::ScopeCreator&>::visit(swift::Stmt*, swift::ast_scope::ASTScopeImpl*, swift::ast_scope::ScopeCreator&) + 73
16  swift                           0x000000010e24e42a swift::ast_scope::ScopeCreator::addToScopeTreeAndReturnInsertionPoint(swift::ASTNode, swift::ast_scope::ASTScopeImpl*) + 122
17  swift                           0x000000010e251535 swift::ast_scope::AbstractFunctionBodyScope::expandSpecifically(swift::ast_scope::ScopeCreator&) + 53
18  swift                           0x000000010e250de6 swift::ast_scope::ASTScopeImpl::expandAndBeCurrent(swift::ast_scope::ScopeCreator&) + 150
19  swift                           0x000000010e250d3f swift::ExpandASTScopeRequest::evaluate(swift::Evaluator&, swift::ast_scope::ASTScopeImpl*, swift::ast_scope::ScopeCreator*) const + 15
20  swift                           0x000000010e2602a5 llvm::Expected<swift::ExpandASTScopeRequest::OutputType> swift::Evaluator::getResultUncached<swift::ExpandASTScopeRequest>(swift::ExpandASTScopeRequest const&) + 469
21  swift                           0x000000010e250c2e swift::ExpandASTScopeRequest::OutputType swift::evaluateOrDefault<swift::ExpandASTScopeRequest>(swift::Evaluator&, swift::ExpandASTScopeRequest, swift::ExpandASTScopeRequest::OutputType) + 94
22  swift                           0x000000010e26328e swift::ast_scope::ASTScopeImpl::findInnermostEnclosingScope(swift::SourceLoc, swift::NullablePtr<llvm::raw_ostream>) + 62
23  swift                           0x000000010e24e33f swift::ASTScope::expandFunctionBody(swift::AbstractFunctionDecl*) + 79
24  swift                           0x000000010e042fbc swift::TypeCheckFunctionBodyUntilRequest::evaluate(swift::Evaluator&, swift::AbstractFunctionDecl*, swift::SourceLoc) const + 812
25  swift                           0x000000010e049fdb llvm::Expected<swift::TypeCheckFunctionBodyUntilRequest::OutputType> swift::Evaluator::getResultUncached<swift::TypeCheckFunctionBodyUntilRequest>(swift::TypeCheckFunctionBodyUntilRequest const&) + 491
26  swift                           0x000000010e049b71 llvm::Expected<swift::TypeCheckFunctionBodyUntilRequest::OutputType> swift::Evaluator::getResultCached<swift::TypeCheckFunctionBodyUntilRequest, (void*)0>(swift::TypeCheckFunctionBodyUntilRequest const&) + 129
27  swift                           0x000000010e0438d9 swift::TypeCheckFunctionBodyUntilRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckFunctionBodyUntilRequest>(swift::Evaluator&, swift::TypeCheckFunctionBodyUntilRequest, swift::TypeCheckFunctionBodyUntilRequest::OutputType) + 41
28  swift                           0x000000010e042c22 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 66
29  swift                           0x000000010e072d2e swift::TypeCheckSourceFileRequest::evaluate(swift::Evaluator&, swift::SourceFile*) const + 494
30  swift                           0x000000010e074c21 llvm::Expected<swift::TypeCheckSourceFileRequest::OutputType> swift::Evaluator::getResultUncached<swift::TypeCheckSourceFileRequest>(swift::TypeCheckSourceFileRequest const&) + 449
31  swift                           0x000000010e0749a4 llvm::Expected<swift::TypeCheckSourceFileRequest::OutputType> swift::Evaluator::getResultCached<swift::TypeCheckSourceFileRequest, (void*)0>(swift::TypeCheckSourceFileRequest const&) + 52
32  swift                           0x000000010e072a50 swift::TypeCheckSourceFileRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckSourceFileRequest>(swift::Evaluator&, swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType) + 32
33  swift                           0x000000010d43b6de swift::CompilerInstance::parseAndTypeCheckMainFileUpTo(swift::SourceFile::ASTStage_t) + 286
34  swift                           0x000000010d43a7b7 swift::CompilerInstance::parseAndCheckTypesUpTo(swift::CompilerInstance::ImplicitImports const&, swift::SourceFile::ASTStage_t) + 359
35  swift                           0x000000010d43a1d8 swift::CompilerInstance::performSemaUpTo(swift::SourceFile::ASTStage_t) + 520
36  swift                           0x000000010d348cdd performCompile(swift::CompilerInstance&, swift::CompilerInvocation const&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) + 1933
37  swift                           0x000000010d34759e swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3582
38  swift                           0x000000010d2db68d main + 861
39  libdyld.dylib                   0x00007fff6beb77fd start + 1
@nathawes
Copy link
Collaborator Author

nathawes commented Apr 2, 2020

@swift-ci create

@CodaFi
Copy link
Member

CodaFi commented May 11, 2020

Resolved by 4c4bf08

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the compiler The Swift compiler in itself label Dec 13, 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 found by stress tester Flag: An issue found by the SourceKit stress tester
Projects
None yet
Development

No branches or pull requests

3 participants