[Lldb-commits] [PATCH] Redirect stdin, stdout and stderr to /dev/null when launching LLGS process.
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1053 bytes
Desc: not available
More information about the lldb-commits