[Lldb-commits] [lldb] [LLDB] Acquire the module mutex at the start of SetLoadAddress (PR #227149)

Jacob Lalonde via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 28 18:26:01 PDT 2026


https://github.com/Jlalond updated https://github.com/llvm/llvm-project/pull/227149

>From 63ada09823fb546d2c4f3cd9a669c02b5db57e2e Mon Sep 17 00:00:00 2001
From: Jacob Lalonde <jalalonde at fb.com>
Date: Mon, 28 Sep 2026 14:59:12 -0700
Subject: [PATCH] Acquire the module mutex at the start of SetLoadAddress,
 becuase ObjectFileELF calls back to module to acquire the mutex, potentially
 causing a deadlock

---
 lldb/source/Core/Module.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index 989410b23c997..73caf527a4b9f 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -1447,6 +1447,7 @@ bool Module::SetArchitecture(const ArchSpec &new_arch) {
 
 bool Module::SetLoadAddress(Target &target, lldb::addr_t value,
                             bool value_is_offset, bool &changed) {
+  std::lock_guard<std::recursive_mutex> guard(m_mutex);
   ObjectFile *object_file = GetObjectFile();
   if (object_file != nullptr) {
     changed = object_file->SetLoadAddress(target, value, value_is_offset);



More information about the lldb-commits mailing list