[Lldb-commits] [PATCH] Fix deadlock in ExecuteOneLine on Windows

Zachary Turner zturner at google.com
Wed Oct 8 13:18:29 PDT 2014


Hi clayborg,

Python one-line execution was using ConnectionFileDescriptor to do a non-blocking read against a pipe.  This won't work on Windows, as CFD is implemented using select(), and select() only works with sockets on Windows.

The solution is to use ConnectionGenericFile on Windows, which uses the native API to do overlapped I/O on the pipe.  This in turn requires re-implementing Host::Pipe on Windows using native OS handles instead of the more portable _pipe CRT api.

There is an outstanding issue after applying this patch, which is that output re-direction doesn't seem to be happening (i.e. the read end of the pipe is not detecting data on the pipe before it is closed).  This will be investigated separately in a follow-up patch.

http://reviews.llvm.org/D5679

Files:
  include/lldb/Host/Pipe.h
  include/lldb/Host/posix/PipePosix.h
  include/lldb/Host/windows/PipeWindows.h
  source/Host/CMakeLists.txt
  source/Host/common/Pipe.cpp
  source/Host/posix/PipePosix.cpp
  source/Host/windows/ConnectionGenericFileWindows.cpp
  source/Host/windows/PipeWindows.cpp
  source/Interpreter/ScriptInterpreterPython.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5679.14594.patch
Type: text/x-patch
Size: 21318 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20141008/d74e9bb9/attachment.bin>


More information about the lldb-commits mailing list