<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">On 8 Feb 2018, at 02:35, Pavel Labath <<a href="mailto:labath@google.com" class="">labath@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Thanks for checking this. This confirms to me that it should be<br class="">possible to make things "just work". Why it does not work is not clear<br class="">to me, but I think we should figure that out. I made some experiments<br class=""><br class="">Can you dig a bit deeper into why things are failing _without_ your<br class="">patch. The two things I would check is:<br class="">- is LLGS being passed the correct address on the command line (172.17.0.2)<br class="">- does that address make it all the way to the address-checking code<br class="">(TCPSocket::Accept)<br class=""></div></div></blockquote><div><br class=""></div><div>So, running this again without the flag, I get the following inside the container:</div><div><br class=""></div><div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">lldb-server platform --server --listen *:4000 --min-gdbserver-port 4001 --max-gdbserver-port 4010</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">\- /usr/bin/lldb-server gdbserver <a href="tcp://172.17.0.1:4001" class="">tcp://172.17.0.1:4001</a> --native-regs</div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">So it's passing an IP address that makes sense inside the container.</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Looking at netstat inside the container:</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""># netstat -n | grep 4000</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">tcp        0      0 172.17.0.2:</span><span style="font-variant-ligatures: no-common-ligatures; color: #c33720" class=""><b class="">4000</b></span><span style="font-variant-ligatures: no-common-ligatures" class="">         172.17.0.1:39840        ESTABLISHED</span></div></span></div></div><div><br class=""></div><div>and outside:</div><div><br class=""></div><div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">$ netstat -n | grep 400</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">tcp6       0      0  ::1.4001               ::1.60819              ESTABLISHED</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">tcp6       0      0  ::1.60819              ::1.4001               ESTABLISHED</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">tcp6       0      0  ::1.4000               ::1.60810              ESTABLISHED</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">tcp6       0      0  ::1.60810              ::1.4000               ESTABLISHED</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">I'm connecting via the symbolic name 'localhost' here, which Docker looks like it's helpfully translating the IPv6 to IPv4.</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">If I connect with <a href="connect://127.0.0.1" class="">connect://127.0.0.1</a> instead, it seems to do the sensible thing as well:</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">$ netstat -n | grep 400</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">tcp4       0      0  127.0.0.1.4001         127.0.0.1.60827        ESTABLISHED</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">tcp4       0      0  127.0.0.1.60827        127.0.0.1.4001         ESTABLISHED</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">tcp4       0      0  127.0.0.1.4000         127.0.0.1.60826        ESTABLISHED</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">tcp4       0      0  127.0.0.1.60826        127.0.0.1.4000         ESTABLISHED</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></span></div></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""># netstat -n | grep 400</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">tcp        0      0 172.17.0.2:</span><span style="font-variant-ligatures: no-common-ligatures" class="">4001         172.17.0.1:60814        ESTABLISHED</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">tcp        0      0 172.17.0.2:</span><span style="font-variant-ligatures: no-common-ligatures" class="">4000         172.17.0.1:39850        ESTABLISHED</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><br class=""></div></div>However, if I run it as is, it seems to work as expected. So my patch now seems unnecessary :(<div class=""><br class=""></div><div class="">The only thing I can think of is that the original derivation of this patch was back in 2016, which would have been before the last change to that line in April 2017, so maybe there was a difference in behaviour of the code used before then, or that there has been some change in the Docker engine for the type of network it defaulted to at the time (which may have been bridge, but I don't have the proof of that) which prevented the getpeername from correctly identifying the code. I've been trying to reproduce the original issue based on what I recall using at the time, but I can't get it to fail in the same way.</div><div class=""><br class=""></div><div class="">So, I think the code works as expected and the patch is unnecessary any more. Thanks for your time in reviewing and making me recheck my assumptions!</div><div class=""><br class=""></div><div class="">Alex</div></body></html>