[Lldb-commits] [lldb] [lldb][windows] mitigate a race condition when closing the ConPTY (PR #182109)

via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 19 06:58:04 PST 2026


https://github.com/Nerixyz approved this pull request.

As a temporary workaround, this looks okay.

I could also reproduce this (occasionally) with `Driver/TestEmptyArgument.test`. 

> This might be because we have a non blocking `ReadFile` call. Maybe having a blocking `ReadFile` call would allow us to do the read atomically and to bypass the race condition.

Found https://redirect.github.com/microsoft/terminal/pull/17510, which claims that overlapped IO is supported.

Don't know if this is relevant, but when debugging, I noticed that the final `GetOverlappedResult` sometimes fails with `ERROR_BROKEN_PIPE` whereas in other cases there's no error, and we get an EOF with zero bytes read. Though https://github.com/microsoft/terminal/discussions/17716#discussioncomment-10341857 mentions that this is to be expected when closing pipes.

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


More information about the lldb-commits mailing list