https://github.com/charles-zablit created 
https://github.com/llvm/llvm-project/pull/181809

On Windows, `ThreadedCommunication::ReadThread` can fail with `ENXIO` when the 
ConPTY is closed. Currently it's not caught, causing the `ReadThread` to 
continue forever because `done` is never set to `true`. This causes an infinite 
hang.

>From b4a2d67a3ac3878830ac8310a876db6a8f938eb0 Mon Sep 17 00:00:00 2001
From: Charles Zablit <[email protected]>
Date: Tue, 17 Feb 2026 11:57:13 +0000
Subject: [PATCH] [lldb][windows] handle ENXIO error

---
 lldb/source/Core/ThreadedCommunication.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lldb/source/Core/ThreadedCommunication.cpp 
b/lldb/source/Core/ThreadedCommunication.cpp
index 649ce71c29374..163708ab937b7 100644
--- a/lldb/source/Core/ThreadedCommunication.cpp
+++ b/lldb/source/Core/ThreadedCommunication.cpp
@@ -293,6 +293,12 @@ lldb::thread_result_t ThreadedCommunication::ReadThread() {
         disconnect = GetCloseOnEOF();
         done = true;
       }
+      if (error.GetType() == eErrorTypeWin32 && error.GetError() == ENXIO) {
+        // ENXIO on a pipe is usually caused by a remote shutdown of the
+        // attached ConPTY
+        disconnect = GetCloseOnEOF();
+        done = true;
+      }
       if (error.Fail())
         LLDB_LOG(log, "error: {0}, status = {1}", error,
                  ThreadedCommunication::ConnectionStatusAsString(status));

_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to