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-12957] SourceKit RangeInfo: Assertion failed: (ContextStack.back().Parent.getOpaqueValue() == Node.getOpaqueValue()) #55403

Open
nathawes opened this issue Jun 9, 2020 · 1 comment

Comments

@nathawes
Copy link
Collaborator

@nathawes nathawes commented Jun 9, 2020

Previous ID SR-12957
Radar rdar://problem/64139829
Original Reporter @nathawes
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Bug, FoundByStressTester
Assignee None
Priority Medium

md5: 5c4aa6c1c5dc3f63cfb603e58eb1d4f6

Issue Description:

Reproducer using latest master and 5.3 snapshot toolchains:

class Foo {
  static let main = Foo()
}

func bar(x: Foo = /*range start*/.main/*range end*/) {}

Trace:

0.  While evaluating request RangeInfoRequest(/private/tmp/sdsdfsddsfds/sdsdfsddsfds/main.swift: (12:19, 12:24))
1.  While walking into decl 'bar(x:)' (at /private/tmp/sdsdfsddsfds/sdsdfsddsfds/main.swift:12:1)
 
Assertion failed: (ContextStack.back().Parent.getOpaqueValue() == Node.getOpaqueValue()), function leave, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/lib/IDE/IDERequests.cpp, line 634.

Thread 1 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  0x000000010f7fd723 RangeResolver::Implementation::leave(swift::ASTNode) (.cold.1) + 35
6   com.apple.SourceKitService.5.0.20200604101_osx  0x000000010c7c07bc RangeResolver::Implementation::leave(swift::ASTNode) + 892
7   com.apple.SourceKitService.5.0.20200604101_osx  0x000000010c7c0820 RangeResolver::walkToDeclPost(swift::Decl*) + 32
8   com.apple.SourceKitService.5.0.20200604101_osx  0x000000010c7bd0d3 (anonymous namespace)::SemaAnnotator::walkToDeclPost(swift::Decl*) + 147
9   com.apple.SourceKitService.5.0.20200604101_osx  0x000000010d5c97ab (anonymous namespace)::Traversal::doIt(swift::Decl*) + 251
10  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010d5c969b swift::Decl::walk(swift::ASTWalker&) + 27
11  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010d6f55f8 swift::SourceFile::walk(swift::ASTWalker&) + 232
12  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010c7bae7f swift::SourceEntityWalker::walk(swift::SourceFile&) + 255
13  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010c7c0bf3 RangeResolver::resolve() + 51
14  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010c7c10d6 swift::RangeInfoRequest::evaluate(swift::Evaluator&, swift::RangeInfoOwner) const + 86
15  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010c7c1b50 swift::SimpleRequest<swift::RangeInfoRequest, swift::ide::ResolvedRangeInfo (swift::RangeInfoOwner), (swift::RequestFlags)2>::evaluateRequest(swift::RangeInfoRequest const&, swift::Evaluator&) + 32
16  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010c6707d2 llvm::Expected<swift::RangeInfoRequest::OutputType> swift::Evaluator::getResultUncached<swift::RangeInfoRequest>(swift::RangeInfoRequest const&) + 354
17  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010c6703a7 llvm::Expected<swift::RangeInfoRequest::OutputType> swift::Evaluator::getResultCached<swift::RangeInfoRequest, (void*)0>(swift::RangeInfoRequest const&) + 247
18  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010c670181 swift::RangeInfoRequest::OutputType swift::evaluateOrDefault<swift::RangeInfoRequest>(swift::Evaluator&, swift::RangeInfoRequest, swift::RangeInfoRequest::OutputType) + 33
19  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010c760ff7 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
20  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010c665bbb 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
21  com.apple.SourceKitService.5.0.20200604101_osx  0x000000010c61f71f void SourceKit::WorkQueue::DispatchData::callAndDelete<SourceKit::ASTUnit::Implementation::consumeAsync(std::__1::shared_ptr<SourceKit::SwiftASTConsumer>, llvm::IntrusiveRefCntPtr<SourceKit::ASTUnit>)::$_0>(void*) + 95
22  libdispatch.dylib               0x00007fff6b28c658 _dispatch_client_callout + 8
23  libdispatch.dylib               0x00007fff6b291c44 _dispatch_lane_serial_drain + 597
24  libdispatch.dylib               0x00007fff6b2925d6 _dispatch_lane_invoke + 363
25  libdispatch.dylib               0x00007fff6b29bc09 _dispatch_workloop_worker_thread + 596
26  libsystem_pthread.dylib         0x00007fff6b4e6a3d _pthread_wqthread + 290
27  libsystem_pthread.dylib         0x00007fff6b4e5b77 start_wqthread + 15
@nathawes
Copy link
Collaborator Author

@nathawes nathawes commented Jun 9, 2020

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant