[all-commits] [llvm/llvm-project] 250f79: [lldb] Fix tsan error in SymbolLocatorDebugSymbols...
Raphael Isemann via All-commits
all-commits at lists.llvm.org
Fri Jul 17 00:15:06 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 250f791e7002afb308e4a59dc5ef3e1f2e1c10af
https://github.com/llvm/llvm-project/commit/250f791e7002afb308e4a59dc5ef3e1f2e1c10af
Author: Raphael Isemann <rise at apple.com>
Date: 2026-07-17 (Fri, 17 Jul 2026)
Changed paths:
M lldb/source/Plugins/SymbolLocator/DebugSymbols/SymbolLocatorDebugSymbols.cpp
Log Message:
-----------
[lldb] Fix tsan error in SymbolLocatorDebugSymbols (#209698)
g_dlsym_DBGCopyFullDSYMURLForUUID and g_dlsym_DBGCopyDSYMPropertyLists
are two globals that are lazily initialized when first used. TSan
complains that this lazy init code is not thread-safe as there is no
synchronization mechanism. In practice, the only race that can happen
here is that we initialize the same values concurrently, which should be
'safe' on any platform.
This patch moves the initialization code into a static local that
returns a const object. This makes this code thread-safe by construction
and fixes the TSan error.
It also fixes that we keep calling dlopen if the initialization fails.
That is, the `g_dlsym_DBGCopyFullDSYMURLForUUID == nullptr` will always
be true on systems where the framework doesn't exist, so this code will
try loading it on every function call and fail.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list