Skip to content

Assertion failed: (Ptr && "Cannot dereference a null Type!") in swift::symbolgraphgen::Symbol::getEffectiveAccessLevel #61201

@ahoppen

Description

@ahoppen

The following new test case hits an assertion failure

// RUN: %sourcekitd-test -req=cursor -pos=9:28 -req-opts=retrieve_symbol_graph=1 %s -- %s

extension ResourceRecordType {
    public var debugDescription: String {
        public struct HostRecord<IPType: IP> {
        }
        extension HostRecord: Hashable {
            public struct StartOfAuthorityRecord {
                public var a
            }
        }
    }
}

Stack trace

Thread 2 Crashed::  Dispatch queue: sourcekit.swift.ConsumeAST
0   libsystem_kernel.dylib        	    0x7ff80ee5630e __pthread_kill + 10
1   libsystem_pthread.dylib       	    0x7ff80ee8df7b pthread_kill + 263
2   libsystem_c.dylib             	    0x7ff80edd7d3f __abort + 139
3   libsystem_c.dylib             	    0x7ff80edd7cb4 abort + 138
4   libsystem_c.dylib             	    0x7ff80edd6fbe __assert_rtn + 314
5   SourceKitService              	       0x103cab183 swift::symbolgraphgen::Symbol::getEffectiveAccessLevel(swift::ExtensionDecl const*) (.cold.1) + 35
6   SourceKitService              	       0x103ca7e59 swift::symbolgraphgen::Symbol::getEffectiveAccessLevel(swift::ExtensionDecl const*) + 313
7   SourceKitService              	       0x103cb9f01 swift::symbolgraphgen::SymbolGraph::isImplicitlyPrivate(swift::Decl const*, bool) const + 321
8   SourceKitService              	       0x103cb9fb5 swift::symbolgraphgen::SymbolGraph::isImplicitlyPrivate(swift::Decl const*, bool) const + 501
9   SourceKitService              	       0x103cb9fb5 swift::symbolgraphgen::SymbolGraph::isImplicitlyPrivate(swift::Decl const*, bool) const + 501
10  SourceKitService              	       0x103cb9fb5 swift::symbolgraphgen::SymbolGraph::isImplicitlyPrivate(swift::Decl const*, bool) const + 501
11  SourceKitService              	       0x103cb9fb5 swift::symbolgraphgen::SymbolGraph::isImplicitlyPrivate(swift::Decl const*, bool) const + 501
12  SourceKitService              	       0x103cb9ef1 swift::symbolgraphgen::SymbolGraph::isImplicitlyPrivate(swift::Decl const*, bool) const + 305
13  SourceKitService              	       0x103cb9fb5 swift::symbolgraphgen::SymbolGraph::isImplicitlyPrivate(swift::Decl const*, bool) const + 501
14  SourceKitService              	       0x103cb9fb5 swift::symbolgraphgen::SymbolGraph::isImplicitlyPrivate(swift::Decl const*, bool) const + 501
15  SourceKitService              	       0x103cb8ff7 swift::symbolgraphgen::SymbolGraph::recordMemberRelationship(swift::symbolgraphgen::Symbol) + 391
16  SourceKitService              	       0x103cb8db3 swift::symbolgraphgen::SymbolGraph::recordNode(swift::symbolgraphgen::Symbol) + 99
17  SourceKitService              	       0x103cbf905 swift::symbolgraphgen::printSymbolGraphForDecl(swift::ValueDecl const*, swift::Type, bool, swift::symbolgraphgen::SymbolGraphOptions const&, llvm::raw_ostream&, llvm::SmallVectorImpl<swift::symbolgraphgen::PathComponent>&, llvm::SmallVectorImpl<swift::symbolgraphgen::FragmentInfo>&) + 709
18  SourceKitService              	       0x10277c80d fillSymbolInfo(SourceKit::CursorSymbolInfo&, DeclInfo const&, swift::ModuleDecl*, swift::SourceLoc, bool, SourceKit::SwiftLangSupport&, swift::CompilerInvocation const&, llvm::ArrayRef<llvm::IntrusiveRefCntPtr<SourceKit::ImmutableTextSnapshot> >, llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul, 128ul>&) + 2445
19  SourceKitService              	       0x102774d1a passCursorInfoForDecl(swift::ide::ResolvedCursorInfo const&, swift::ModuleDecl*, bool, bool, 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&)>) + 458
20  SourceKitService              	       0x102773bba resolveCursor(SourceKit::SwiftLangSupport&, llvm::StringRef, unsigned int, unsigned int, bool, bool, llvm::IntrusiveRefCntPtr<SourceKit::SwiftInvocation>, bool, bool, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, void const*, std::__1::function<void (SourceKit::RequestResult<SourceKit::CursorInfoData> const&)>)::CursorInfoConsumer::handlePrimaryAST(llvm::IntrusiveRefCntPtr<SourceKit::ASTUnit>) + 2090
21  SourceKitService              	       0x10276b58f 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             	    0x7ff80ed0ea44 _dispatch_client_callout + 8
23  libdispatch.dylib             	    0x7ff80ed14ac4 _dispatch_lane_serial_drain + 694
24  libdispatch.dylib             	    0x7ff80ed155b4 _dispatch_lane_invoke + 366
25  libdispatch.dylib             	    0x7ff80ed1fad7 _dispatch_workloop_worker_thread + 762
26  libsystem_pthread.dylib       	    0x7ff80ee8ace3 _pthread_wqthread + 326
27  libsystem_pthread.dylib       	    0x7ff80ee89c67 start_wqthread + 15

rdar://100169094

Metadata

Metadata

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions