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-12958] SourceKit RangeInfo: Assertion failed: (ContainedASTNodes.size() == 1), function getSingleNodeKind #55404

Closed
nathawes opened this issue Jun 9, 2020 · 2 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. found by stress tester Flag: An issue found by the SourceKit stress tester

Comments

@nathawes
Copy link
Collaborator

nathawes commented Jun 9, 2020

Previous ID SR-12958
Radar rdar://problem/64140713
Original Reporter @nathawes
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Bug, FoundByStressTester
Assignee @ahoppen
Priority Medium

md5: 26fb0fd91388bd69617bc7c02e2fb49e

Issue Description:

Reproducer using latest master or 5.3 snapshot:

@propertyWrapper
public struct UserDefault<T> {
    init(_ key: String, defaultValue: T) {}
    public var wrappedValue: T {
        get { fatalError() }
        set {}
    }
}

public struct AppUserDefaults {
    /*range start*/@UserDefault("user_region", defaultValue: "US")
    public static var region: String/*range end*/
}

Trace:

0.  While evaluating request RangeInfoRequest(/private/tmp/sdsdfsddsfds/sdsdfsddsfds/main.swift: (18:5, 19:37))
1.  While walking into decl 'AppUserDefaults' (at /private/tmp/sdsdfsddsfds/sdsdfsddsfds/main.swift:17:8)
 
Assertion failed: (ContainedASTNodes.size() == 1), function getSingleNodeKind, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/lib/IDE/IDERequests.cpp, line 529.
Thread 2 Crashed:: Dispatch queue: sourcekit.swift.ConsumeAST
0   libsystem_kernel.dylib          0x00007fff6b42d33a __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff6b4e9e60 pthread_kill + 430
2   libsystem_c.dylib               0x00007fff6b3b48a2 __abort + 139
3   libsystem_c.dylib               0x00007fff6b3b4817 abort + 135
4   libsystem_c.dylib               0x00007fff6b3b3ac6 __assert_rtn + 314
5   com.apple.SourceKitService.5.0.20200604101_osx  0x0000000110531c33 RangeResolver::Implementation::getSingleNodeKind(swift::ASTNode) (.cold.3) + 35
6   com.apple.SourceKitService.5.0.20200604101_osx  0x000000010d4f602d RangeResolver::Implementation::getSingleNodeKind(swift::ASTNode) + 893
7   com.apple.SourceKitService.5.0.20200604101_osx  0x000000010d4f39f9 RangeResolver::Implementation::analyze(swift::ASTNode) + 553
8   com.apple.SourceKitService.5.0.20200604101_osx  0x000000010d4f3973 RangeResolver::Implementation::analyze(swift::ASTNode) + 419
9   com.apple.SourceKitService.5.0.20200604101_osx  0x000000010d4f43e6 RangeResolver::walkToDeclPre(swift::Decl*, swift::CharSourceRange) + 118
10  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010d4f0ec6 (anonymous namespace)::SemaAnnotator::walkToDeclPre(swift::Decl*) + 1638
11  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010e2fd75a (anonymous namespace)::Traversal::doIt(swift::Decl*) + 170
12  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010e301110 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Pattern*) + 192
13  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010e3013a2 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Pattern*) + 850
14  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010e3023ef swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Decl*) + 2031
15  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010e2fd787 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 215
16  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010e302959 (anonymous namespace)::Traversal::visitNominalTypeDecl(swift::NominalTypeDecl*) + 329
17  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010e2fd787 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 215
18  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010e2fd69b swift::Decl::walk(swift::ASTWalker&) + 27
19  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010e4295f8 swift::SourceFile::walk(swift::ASTWalker&) + 232
20  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010d4eee7f swift::SourceEntityWalker::walk(swift::SourceFile&) + 255
21  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010d4f4bf3 RangeResolver::resolve() + 51
22  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010d4f50d6 swift::RangeInfoRequest::evaluate(swift::Evaluator&, swift::RangeInfoOwner) const + 86
23  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010d4f5b50 swift::SimpleRequest<swift::RangeInfoRequest, swift::ide::ResolvedRangeInfo (swift::RangeInfoOwner), (swift::RequestFlags)2>::evaluateRequest(swift::RangeInfoRequest const&, swift::Evaluator&) + 32
24  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010d3a47d2 llvm::Expected<swift::RangeInfoRequest::OutputType> swift::Evaluator::getResultUncached<swift::RangeInfoRequest>(swift::RangeInfoRequest const&) + 354
25  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010d3a43a7 llvm::Expected<swift::RangeInfoRequest::OutputType> swift::Evaluator::getResultCached<swift::RangeInfoRequest, (void*)0>(swift::RangeInfoRequest const&) + 247
26  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010d3a4181 swift::RangeInfoRequest::OutputType swift::evaluateOrDefault<swift::RangeInfoRequest>(swift::Evaluator&, swift::RangeInfoRequest, swift::RangeInfoRequest::OutputType) + 33
27  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010d494ff7 swift::ide::collectAvailableRefactorings(swift::SourceFile*, swift::ide::RangeConfig, bool&, std::__1::vector<swift::ide::RefactoringKind, std::__1::allocator<swift::ide::RefactoringKind> >&, llvm::ArrayRef<swift::DiagnosticConsumer*>) + 1559
28  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010d399bbb resolveCursor(SourceKit::SwiftLangSupport&, llvm::StringRef, unsigned int, unsigned int, bool, llvm::IntrusiveRefCntPtr<SourceKit::SwiftInvocation>, bool, bool, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::__1::function<void (SourceKit::RequestResult<SourceKit::CursorInfoData> const&)>)::CursorInfoConsumer::handlePrimaryAST(llvm::IntrusiveRefCntPtr<SourceKit::ASTUnit>) + 507
29  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010d35371f void SourceKit::WorkQueue::DispatchData::callAndDelete<SourceKit::ASTUnit::Implementation::consumeAsync(std::__1::shared_ptr<SourceKit::SwiftASTConsumer>, llvm::IntrusiveRefCntPtr<SourceKit::ASTUnit>)::$_0>(void*) + 95
30  libdispatch.dylib               0x00007fff6b28c658 _dispatch_client_callout + 8
31  libdispatch.dylib               0x00007fff6b291c44 _dispatch_lane_serial_drain + 597
32  libdispatch.dylib               0x00007fff6b2925d6 _dispatch_lane_invoke + 363
33  libdispatch.dylib               0x00007fff6b29bc09 _dispatch_workloop_worker_thread + 596
34  libsystem_pthread.dylib         0x00007fff6b4e6a3d _pthread_wqthread + 290
35  libsystem_pthread.dylib         0x00007fff6b4e5b77 start_wqthread + 15
@nathawes
Copy link
Collaborator Author

nathawes commented Jun 9, 2020

@swift-ci create

@ahoppen
Copy link
Contributor

ahoppen commented Apr 6, 2021

Fixed in #36629

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 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. found by stress tester Flag: An issue found by the SourceKit stress tester
Projects
None yet
Development

No branches or pull requests

2 participants