<div dir="ltr">Sadly, that gives me nothing in the log file. Also, ConnectionFileDescriptor::Connect already seems to handle this case.<div><br></div><div>Running strace on all child processes gives a “Operation not permitted” error from setsid(). That seems like the culprit, which is strange.<br><div><br></div><div>Would you mind providing the value you used for LLDB_SERVER_LOG_CHANNELS?</div><div><br></div><div>Demi</div></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jul 21, 2017 at 2:55 PM Ted Woodward <<a href="mailto:ted.woodward@codeaurora.org">ted.woodward@codeaurora.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The first thing I'd do is use the lldb logging mechanism. lldb-server closes<br>
its own stdout and stderr, because nobody is interested in output from the<br>
server, just from the target. Except when you're debugging the server, so<br>
there is an easy way to turn on logging.<br>
<br>
Set the following environment variables:<br>
LLDB_DEBUGSERVER_LOG_FILE - this contains the path to the file the logs will<br>
be written to<br>
LLDB_SERVER_LOG_CHANNELS - this contains the channels and categories to turn<br>
logging on for. The format is "channel category:channel category...". If you<br>
want more than 1 category for a channel, I think "channel cat1 cat2..."<br>
works. This is not spelled out very clearly, unfortunately.<br>
<br>
<br>
Quickly glancing at the code, it looks like you need to implement a<br>
socketpair connection, and handling of the fd:// connection URL, starting in<br>
ConnectionFileDescriptor::Connect. The log for this would be "lldb<br>
connection".<br>
<br>
Ted<br>
<br>
--<br>
Qualcomm Innovation Center, Inc.<br>
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a<br>
Linux Foundation Collaborative Project<br>
<br>
> -----Original Message-----<br>
> From: lldb-dev [mailto:<a href="mailto:lldb-dev-bounces@lists.llvm.org" target="_blank">lldb-dev-bounces@lists.llvm.org</a>] On Behalf Of Demi<br>
> Obenour via lldb-dev<br>
> Sent: Wednesday, July 19, 2017 7:44 PM<br>
> To: <a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br>
> Subject: [lldb-dev] Trying to use socketpair for lldb-server fails<br>
><br>
> To avoid a local privilage escalation, I am trying to patch LLDB not to<br>
use a TCP<br>
> socket for local communication.<br>
><br>
> The attached patch failed. Would anyone be able to provide suggestions<br>
for<br>
> how to debug the problem?<br>
><br>
> Sincerely,<br>
><br>
> Demi<br>
<br>
</blockquote></div>