8000 Fix race condition during iteration through modules (#139283) · llvm/llvm-project@2fd4a90 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2fd4a90

Browse files
committed
Fix race condition during iteration through modules (#139283)
Lock ensures modules don't change during iteration.
1 parent 7e098be commit 2fd4a90

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lldb/source/Target/Target.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,6 +1510,7 @@ bool Target::IgnoreWatchpointByID(lldb::watch_id_t watch_id,
15101510
}
15111511

15121512
ModuleSP Target::GetExecutableModule() {
1513+
std::lock_guard<std::recursive_mutex> guard(m_images.GetMutex());
15131514
// search for the first executable in the module list
15141515
for (size_t i = 0; i < m_images.GetSize(); ++i) {
15151516
ModuleSP module_sp = m_images.GetModuleAtIndex(i);

0 commit comments

Comments
 (0)
0