[Lldb-commits] [lldb] [lldb][windows] handle ENXIO error (PR #181809)

via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 17 04:08:23 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Charles Zablit (charles-zablit)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/181809.diff


1 Files Affected:

- (modified) lldb/source/Core/ThreadedCommunication.cpp (+6) 


``````````diff
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));

``````````

</details>


https://github.com/llvm/llvm-project/pull/181809


More information about the lldb-commits mailing list