[llvm-branch-commits] [lldb] 41a431c - [lldb/Target] Revert overly broad locking in StackFrameList::FetchFramesUpTo (#182969)

Douglas Yung via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Mar 5 09:13:11 PST 2026


Author: Med Ismail Bennani
Date: 2026-03-05T17:12:58Z
New Revision: 41a431cc875ba44e2697c2f905730c59a7986162

URL: https://github.com/llvm/llvm-project/commit/41a431cc875ba44e2697c2f905730c59a7986162
DIFF: https://github.com/llvm/llvm-project/commit/41a431cc875ba44e2697c2f905730c59a7986162.diff

LOG: [lldb/Target] Revert overly broad locking in StackFrameList::FetchFramesUpTo (#182969)

(cherry picked from commit 901636112c6a45385a0ef421d32a5fb95374f56e)

Added: 
    

Modified: 
    lldb/source/Target/StackFrameList.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Target/StackFrameList.cpp b/lldb/source/Target/StackFrameList.cpp
index 94329e77460d9..da54120c6793a 100644
--- a/lldb/source/Target/StackFrameList.cpp
+++ b/lldb/source/Target/StackFrameList.cpp
@@ -71,25 +71,14 @@ bool SyntheticStackFrameList::FetchFramesUpTo(
   size_t num_synthetic_frames = 0;
   // Use the provider to generate frames lazily.
   if (m_provider) {
-    // Get starting index under lock.
-    uint32_t start_idx = 0;
-    {
-      std::shared_lock<std::shared_mutex> guard(m_list_mutex);
-      start_idx = m_frames.size();
-    }
-
     // Keep fetching until we reach end_idx or the provider returns an error.
-    for (uint32_t idx = start_idx; idx <= end_idx; idx++) {
+    for (uint32_t idx = m_frames.size(); idx <= end_idx; idx++) {
       if (allow_interrupt &&
           m_thread.GetProcess()->GetTarget().GetDebugger().InterruptRequested())
         return true;
 
-      // Call Python WITHOUT holding lock - prevents deadlock.
       auto frame_or_err = m_provider->GetFrameAtIndex(idx);
 
-      // Acquire lock to modify m_frames.
-      std::unique_lock<std::shared_mutex> guard(m_list_mutex);
-
       if (!frame_or_err) {
         // Provider returned error - we've reached the end.
         LLDB_LOG_ERROR(GetLog(LLDBLog::Thread), frame_or_err.takeError(),
@@ -424,10 +413,6 @@ bool StackFrameList::GetFramesUpTo(uint32_t end_idx,
     return false;
   }
 
-  // Release lock before FetchFramesUpTo which may call Python.
-  // FetchFramesUpTo will acquire locks as needed.
-  guard.unlock();
-
   // We're adding concrete and inlined frames now:
   was_interrupted = FetchFramesUpTo(end_idx, allow_interrupt);
 


        


More information about the llvm-branch-commits mailing list