[Lldb-commits] [PATCH] Redirect stdin, stdout and stderr to /dev/null when launching LLGS process.

Oleksiy Vyalov ovyalov at google.com
Mon Nov 3 17:01:36 PST 2014


Hi apepper, sbest, clayborg,

Closing std handles (but without redirecting them) allows kernel to "reuse" 0,1, 2 file handle ids for subsequent file handle open operations.
This issue may lead to junk data sent over TCP connection from lldb-gdbserver to lldb because stderr file handle might be assigned to the socket handle:

int fd = connection_up->GetReadObject()->GetWaitableHandle();
assert(fd == STDERR_FILENO);  // llgs doesn't crash on such assertion without this code change in.

By redirecting std handles to /dev/null we prevent OS from such std handles reuse.

http://reviews.llvm.org/D6105

Files:
  source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6105.15742.patch
Type: text/x-patch
Size: 1053 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20141104/9287ec73/attachment.bin>


More information about the lldb-commits mailing list