<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>This is big time overkill, but I wasn’t sure where the problem I was tracking down was:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>“lldb all:linux all:gdb-remote all”<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Ted<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>--<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Qualcomm Innovation Center, Inc.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Demi Obenour [mailto:demiobenour@gmail.com] <br><b>Sent:</b> Friday, July 21, 2017 8:54 PM<br><b>To:</b> Ted Woodward <ted.woodward@codeaurora.org>; lldb-dev@lists.llvm.org<br><b>Subject:</b> Re: [lldb-dev] Trying to use socketpair for lldb-server fails<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Sadly, that gives me nothing in the log file.  Also, ConnectionFileDescriptor::Connect already seems to handle this case.<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Running strace on all child processes gives a “Operation not permitted” error from setsid().  That seems like the culprit, which is strange.<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Would you mind providing the value you used for LLDB_SERVER_LOG_CHANNELS?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Demi<o:p></o:p></p></div></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Fri, Jul 21, 2017 at 2:55 PM Ted Woodward <<a href="mailto:ted.woodward@codeaurora.org">ted.woodward@codeaurora.org</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><p class=MsoNormal style='margin-bottom:12.0pt'>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<o:p></o:p></p></blockquote></div></div></div></body></html>