[Lldb-commits] [lldb] 6dc4a4b - [lldb][Windows] Cap the loader helper's one-thread timeout at 5s (#226171)

via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 24 12:47:16 PDT 2026


Author: Charles Zablit
Date: 2026-09-24T20:47:09+01:00
New Revision: 6dc4a4ba2850369afd537001377fb9d404653d26

URL: https://github.com/llvm/llvm-project/commit/6dc4a4ba2850369afd537001377fb9d404653d26
DIFF: https://github.com/llvm/llvm-project/commit/6dc4a4ba2850369afd537001377fb9d404653d26.diff

LOG: [lldb][Windows] Cap the loader helper's one-thread timeout at 5s (#226171)

llvm/llvm-project#215593 replaced the 5s cap from
llvm/llvm-project#213010 with `utility-expression-timeout / 2`. The
test suite sets that to 600s, so the `LoadLibrary` helper runs with
every other inferior thread suspended for up to 300s.

A Swift concurrency inferior cannot finish the load single-threaded, so
it waits for the whole budget before the "all threads" retry succeeds.

This fixes test timeouts in swiftlang.

Added: 
    

Modified: 
    lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
index 924ce798433cf..0e1938b080bba 100644
--- a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
+++ b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
@@ -51,9 +51,13 @@ LLDB_PLUGIN_DEFINE(PlatformWindows)
 static uint32_t g_initialize_count = 0;
 
 // Upper bound on the timeout used when running a utility expression with
-// only one thread allowed to run.
+// only one thread allowed to run. On expiry, RunThreadPlan retries with all
+// threads, so this does not shorten the overall timeout.
 static std::chrono::microseconds GetLoaderOneThreadTimeout(Process *process) {
-  return std::chrono::microseconds(process->GetUtilityExpressionTimeout()) / 2;
+  constexpr std::chrono::seconds preferred(5);
+  return std::min<std::chrono::microseconds>(
+      preferred,
+      std::chrono::microseconds(process->GetUtilityExpressionTimeout()) / 2);
 }
 
 namespace {


        


More information about the lldb-commits mailing list