[Lldb-commits] [PATCH] D87333: [lldb/ipv6] Support running lldb tests in an ipv6-only environment.

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 30 07:11:08 PDT 2020

labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Sorry about the delay.

In D87333#2293266 <https://reviews.llvm.org/D87333#2293266>, @clayborg wrote:

> I am fine with trying "localhost" and seeing if we run into any issues. Hopefully slow DNS isn't a problem anymore on Macs. Everyone else ok?

Sounds good to me. I'm mainly hoping that with the use of socketpair(2), the DNS will not be on the critical path anymore.

In D87333#2274572 <https://reviews.llvm.org/D87333#2274572>, @rupprecht wrote:

> Many non-reproducers tests fail w/o the change to `GDBRemoteCommunication::ConnectLocally`, so it's at least used outside of that.

Well... it is used in a bunch of tests exercising the socket functionality, but these are just tests. The only production usage is in reproducers. Which makes total sense when you think about it -- why would anyone be creating a socket for communicating within the same process -- there are much simpler ways to do that.

In D87333#2291317 <https://reviews.llvm.org/D87333#2291317>, @rupprecht wrote:

> [1] IIUC, when connecting via hostname, attempting "localhost" will try both AF_INET and AF_INET6, but there is no corresponding way to construct a raw socket with automatic fallback to AF_INET6 if AF_INET does not work, so that part is the same as before (try to create AF_INET and catch the error manually)

The fully generic way to handle this would be to loop over getaddrinfo("localhost") and try to listen on each address that returns (multiple sockets). That is at least for the case when you don't know who is going to connect to you. For tests, it should be sufficient to pick a first address that works and use that.

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list