From 1f5f4169c427c51c6919e0013c89a191dba564e8 Mon Sep 17 00:00:00 2001 From: Med Ismail Bennani Date: Thu, 6 Jul 2023 14:32:05 -0700 Subject: [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 --- lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp') diff --git a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp b/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp index 5be1eff..e99a2a0 100644 --- a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp +++ b/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp @@ -166,7 +166,6 @@ void ScriptedProcess::DidLaunch() { m_pid = GetInterface().GetProcessID(); } void ScriptedProcess::DidResume() { // Update the PID again, in case the user provided a placeholder pid at launch m_pid = GetInterface().GetProcessID(); - GetLoadedDynamicLibrariesInfos(); } Status ScriptedProcess::DoResume() { -- cgit v1.1