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-12976] SourceKit cursor-info: Assertion failed: (isa<TopLevelCodeDecl>(dc) || isa<Initializer>(dc) || isa<TypeAliasDecl>(dc) || isa<SubscriptDecl>(dc) || isa<EnumElementDecl>(dc)), function lookupNamesIntroducedByMiscContext #55422

Closed
nathawes opened this issue Jun 11, 2020 · 2 comments

Comments

@nathawes
Copy link
Collaborator

@nathawes nathawes commented Jun 11, 2020

Previous ID SR-12976
Radar rdar://problem/64230277
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: 810fc92083e3f490b3322bd5b3b86d69

Issue Description:

Reproducer on master:

protocol View {}
struct MyView: View {}
func indicator</*cursor-info here*/T>(_ a: T) -> some View {
  MyView()
}

Trace:

Assertion failed: (isa<TopLevelCodeDecl>(dc) || isa<Initializer>(dc) || isa<TypeAliasDecl>(dc) || isa<SubscriptDecl>(dc) || isa<EnumElementDecl>(dc)), function lookupNamesIntroducedByMiscContext, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/lib/AST/UnqualifiedLookup.cpp, line 853.

Thread 4 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.20200609101_osx  0x0000000110d69153 (anonymous namespace)::UnqualifiedLookupFactory::lookupNamesIntroducedBy((anonymous namespace)::UnqualifiedLookupFactory::ContextAndUnresolvedIsCascadingUse, swift::DeclContext*) (.cold.10) + 35
6   com.apple.SourceKitService.5.0.20200609101_osx  0x000000010e89127c (anonymous namespace)::UnqualifiedLookupFactory::lookupNamesIntroducedBy((anonymous namespace)::UnqualifiedLookupFactory::ContextAndUnresolvedIsCascadingUse, swift::DeclContext*) + 2972
7   com.apple.SourceKitService.5.0.20200609101_osx  0x000000010e88ed6c swift::UnqualifiedLookupRequest::evaluate(swift::Evaluator&, swift::UnqualifiedLookupDescriptor) const + 844
8   com.apple.SourceKitService.5.0.20200609101_osx  0x000000010e841453 swift::SimpleRequest<swift::UnqualifiedLookupRequest, swift::LookupResult (swift::UnqualifiedLookupDescriptor), (swift::RequestFlags)25>::evaluateRequest(swift::UnqualifiedLookupRequest const&, swift::Evaluator&) + 35
9   com.apple.SourceKitService.5.0.20200609101_osx  0x000000010d77f582 llvm::Expected<swift::UnqualifiedLookupRequest::OutputType> swift::Evaluator::getResultUncached<swift::UnqualifiedLookupRequest>(swift::UnqualifiedLookupRequest const&) + 354
10  com.apple.SourceKitService.5.0.20200609101_osx  0x000000010d77f3c6 llvm::Expected<swift::UnqualifiedLookupRequest::OutputType> swift::Evaluator::operator()<swift::UnqualifiedLookupRequest, (void*)0>(swift::UnqualifiedLookupRequest const&) + 118
11  com.apple.SourceKitService.5.0.20200609101_osx  0x000000010d77ec16 swift::UnqualifiedLookupRequest::OutputType swift::evaluateOrDefault<swift::UnqualifiedLookupRequest>(swift::Evaluator&, swift::UnqualifiedLookupRequest, swift::UnqualifiedLookupRequest::OutputType) + 38
12  com.apple.SourceKitService.5.0.20200609101_osx  0x000000010d77acbb passCursorInfoForDecl(swift::SourceFile*, swift::ValueDecl const*, swift::ModuleDecl*, swift::Type, bool, bool, swift::ide::ResolvedCursorInfo, llvm::Optional<unsigned int>, swift::SourceLoc, llvm::ArrayRef<SourceKit::RefactoringInfo>, SourceKit::SwiftLangSupport&, swift::CompilerInvocation const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, llvm::ArrayRef<llvm::IntrusiveRefCntPtr<SourceKit::ImmutableTextSnapshot> >, std::__1::function<void (SourceKit::RequestResult<SourceKit::CursorInfoData> const&)>) + 5611
13  com.apple.SourceKitService.5.0.20200609101_osx  0x000000010d778256 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>) + 4294
14  com.apple.SourceKitService.5.0.20200609101_osx  0x000000010d7309ff void SourceKit::WorkQueue::DispatchData::callAndDelete<SourceKit::ASTUnit::Implementation::consumeAsync(std::__1::shared_ptr<SourceKit::SwiftASTConsumer>, llvm::IntrusiveRefCntPtr<SourceKit::ASTUnit>)::$_0>(void*) + 95
15  libdispatch.dylib               0x00007fff6b28c658 _dispatch_client_callout + 8
16  libdispatch.dylib               0x00007fff6b291c44 _dispatch_lane_serial_drain + 597
17  libdispatch.dylib               0x00007fff6b2925d6 _dispatch_lane_invoke + 363
18  libdispatch.dylib               0x00007fff6b29bc09 _dispatch_workloop_worker_thread + 596
19  libsystem_pthread.dylib         0x00007fff6b4e6a3d _pthread_wqthread + 290
20  libsystem_pthread.dylib         0x00007fff6b4e5b77 start_wqthread + 15
@nathawes
Copy link
Collaborator Author

@nathawes nathawes commented Jun 11, 2020

@swift-ci create

@ahoppen
Copy link
Collaborator

@ahoppen ahoppen commented Mar 22, 2021

Fixed in #36514

@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
Projects
None yet
Development

No branches or pull requests

2 participants