[all-commits] [llvm/llvm-project] 9621be: [lldb] Only preload a Module's symbols once (#213094)

Charles Zablit via All-commits all-commits at lists.llvm.org
Fri Jul 31 02:49:53 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9621bedd8a7a09c5e48a12697ff2d0463067e341
      https://github.com/llvm/llvm-project/commit/9621bedd8a7a09c5e48a12697ff2d0463067e341
  Author: Charles Zablit <c_zablit at apple.com>
  Date:   2026-07-31 (Fri, 31 Jul 2026)

  Changed paths:
    M lldb/include/lldb/Core/Module.h
    M lldb/source/Core/Module.cpp

  Log Message:
  -----------
  [lldb] Only preload a Module's symbols once (#213094)

Creating several targets for the same file concurrently could deadlock.

Targets share Module objects. Therefore, each concurrent
`SBDebugger::CreateTarget()` call creates a `PreloadSymbols()` task for
the *same* Module. The thread pool running those tasks can pick up a
duplicate preload task for the same Module. The mutex used by the Module
is recursive, so the thread starts the task again, enters the same
`std::call_once` and deadlocks.

Preloading only needs to happen once: it does work taht a later lookup
would do anyway. If it's already in progress, skip it. This deduplicate
the task that causes the deadlock.

At desk, this fixes a timeout in
`api/multiple-targets/TestMultipleTargets.py`, roughly 1/40 runs. To
reproduce the issue, I shrunk the thread pool to 2 threads, which makes
it always timeout.



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