[all-commits] [llvm/llvm-project] 1f5f41: [lldb] Fix dead lock issue when loading modules in...

Med Ismail Bennani via All-commits all-commits at lists.llvm.org
Thu Jul 6 14:35:26 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1f5f4169c427c51c6919e0013c89a191dba564e8
      https://github.com/llvm/llvm-project/commit/1f5f4169c427c51c6919e0013c89a191dba564e8
  Author: Med Ismail Bennani <ismail at bennani.ma>
  Date:   2023-07-06 (Thu, 06 Jul 2023)

  Changed paths:
    M lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
    M lldb/source/Plugins/Process/scripted/ScriptedProcess.h

  Log Message:
  -----------
  [lldb] Fix dead lock issue when loading modules in Scripted Process

This patch attempts to fix a dead lock when loading modules in a Scripted
Process.

This issue was triggered by loading the modules after the process did resume,
but before the process actually stop, causing the language runtime mutex to
be locked by a separate thread, responsible to unwind the stack (using
the runtime unwind plan), while the module loading thread was trying to
notify the runtimes of the newly loaded module.

To address that, this patch moves the module loading logic to be done before
sending the stop event, to prevent the dead lock situation described above.

Differential Revision: https://reviews.llvm.org/D154649

Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>




More information about the All-commits mailing list