While debugging a Swift application in Xcode, LLDB crashes with an assertion failure related to LLDBMemoryReader and pointer authentication. The issue occurs during normal debugging (e.g. inspecting variables or stack frames), and causes the debugger to become unusable.
The error appears to be triggered inside the Swift language runtime reflection path in LLDB
error: Assertion failed: (LLDBMemoryReader module to address map ran into pointer authentication mask!), function addModuleToAddressMap, file /AppleInternal/Library/BuildRoots/603ae698-b099-11ef-b64c-aabfac210453/Library/Caches/com.apple.xbs/Sources/lldb/llvm-project/lldb/source/Plugins/LanguageRuntime/Swift/LLDBMemoryReader.cpp, line 537
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 LLDB 0x00000001240eb8f8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 40
1 LLDB 0x0000000123bbd0a8 lldb_private::lldb_assert(bool, char const*, char const*, char const*, unsigned int) + 184
2 LLDB 0x0000000123d5379d lldb_private::LLDBMemoryReader::addModuleToAddressMap(std::__1::shared_ptr<lldb_private::Module>, bool) + 477
3 LLDB 0x0000000123dbb733 lldb_private::SwiftLanguageRuntimeImpl::AddObjectFileToReflectionContext(std::__1::shared_ptr<lldb_private::Module>, llvm::SmallVector<llvm::StringRef, 1u>) + 1043
4 LLDB 0x0000000123dbc6de lldb_private::SwiftLanguageRuntimeImpl::AddModuleToReflectionContext(std::__1::shared_ptr<lldb_private::Module> const&) + 2766
5 LLDB 0x0000000123dc6d60 std::__1::__function::__func<lldb_private::SwiftLanguageRuntimeImpl::ProcessModulesToAdd()::$_0, std::__1::allocator<lldb_private::SwiftLanguageRuntimeImpl::ProcessModulesToAdd()::$_0>, bool (std::__1::shared_ptr<lldb_private::Module> const&)>::operator()(std::__1::shared_ptr<lldb_private::Module> const&) + 32
6 LLDB 0x00000001239bdad2 lldb_private::ModuleList::ForEach(std::__1::function<bool (std::__1::shared_ptr<lldb_private::Module> const&)> const&) const + 66
7 LLDB 0x0000000123dba72a lldb_private::SwiftLanguageRuntimeImpl::ProcessModulesToAdd() + 346
8 LLDB 0x0000000123dba0c9 lldb_private::SwiftLanguageRuntimeImpl::GetReflectionContext() + 57
9 LLDB 0x0000000123dd32e9 lldb_private::SwiftLanguageRuntimeImpl::BindGenericTypeParameters(lldb_private::StackFrame&, lldb_private::TypeSystemSwiftTypeRef&, lldb_private::ConstString) + 121
10 LLDB 0x0000000123dd3b8b lldb_private::SwiftLanguageRuntimeImpl::BindGenericTypeParameters(lldb_private::StackFrame&, lldb_private::CompilerType) + 347
11 LLDB 0x0000000123dc980d lldb_private::SwiftLanguageRuntimeImpl::GetSwiftRuntimeTypeInfo(lldb_private::CompilerType, lldb_private::ExecutionContextScope*, swift::reflection::TypeRef const**) + 621
12 LLDB 0x0000000123dcf9b1 lldb_private::SwiftLanguageRuntimeImpl::GetBitSize(lldb_private::CompilerType, lldb_private::ExecutionContextScope*) + 49
13 LLDB 0x0000000123dc332f lldb_private::SwiftLanguageRuntime::GetBitSize(lldb_private::CompilerType, lldb_private::ExecutionContextScope*) + 63
14 LLDB 0x0000000123fb0dd1 lldb_private::TypeSystemSwiftTypeRef::GetBitSize(void*, lldb_private::ExecutionContextScope*)::$_0::operator()() const + 689
15 LLDB 0x0000000123fb0aa8 lldb_private::TypeSystemSwiftTypeRef::GetBitSize(void*, lldb_private::ExecutionContextScope*) + 440
16 LLDB 0x0000000123aa9d61 lldb_private::CompilerType::GetBitSize(lldb_private::ExecutionContextScope*) const + 241
17 LLDB 0x0000000123aa9dc9 lldb_private::CompilerType::GetByteSize(lldb_private::ExecutionContextScope*) const + 9
18 LLDB 0x00000001239ef9e1 lldb_private::ValueObjectVariable::UpdateValue() + 241
19 LLDB 0x00000001239d9993 lldb_private::ValueObject::UpdateValueIfNeeded(bool) + 1011
20 LLDB 0x00000001239dac20 lldb_private::ValueObject::GetError() + 16
21 LLDB 0x0000000123868231 ValueImpl::GetSP(lldb_private::ProcessRunLock::ProcessRunLocker&, std::__1::unique_lock<std::__1::recursive_mutex>&, lldb_private::Status&) + 145
22 LLDB 0x000000012385cd28 lldb::SBValue::GetSP(ValueLocker&) const + 376
23 LLDB 0x000000012385dab9 lldb::SBValue::GetValueType() + 297
24 lldb-rpc-server 0x000000010f2f730a rpc_server::_ZN4lldb7SBValue12GetValueTypeEv::HandleRPCCall(rpc_common::Connection&, rpc_common::RPCStream&, rpc_common::RPCStream&) + 42
25 lldb-rpc-server 0x000000010f300749 rpc_common::Connection::PrivateHandleRPCPacket(rpc_common::RPCPacket&, rpc_common::RPCPacket&, bool&) + 1337
26 lldb-rpc-server 0x000000010f304434 Packets::ProcessPackets() + 564
27 lldb-rpc-server 0x000000010f30418a Packets::ReadThread() + 314
28 lldb-rpc-server 0x000000010f304049 Packets::RunReadThread(void*) + 9
29 libsystem_pthread.dylib 0x00007ff81847018b _pthread_start + 99
30 libsystem_pthread.dylib 0x00007ff81846bae3 thread_start + 15
Please file a bug report against lldb reporting this failure log, and as many details as possibleerror: Assertion failed: (LLDBMemoryReader module to address map ran into pointer authentication mask!), function addModuleToAddressMap, file /AppleInternal/Library/BuildRoots/603ae698-b099-11ef-b64c-aabfac210453/Library/Caches/com.apple.xbs/Sources/lldb/llvm-project/lldb/source/Plugins/LanguageRuntime/Swift/LLDBMemoryReader.cpp, line 537