From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13011 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: getaddrinfo(3) / AI_ADDRCONFIG Date: Tue, 10 Jul 2018 11:08:54 -0400 Message-ID: <20180710150854.GU1392@brightrain.aerifal.cx> References: <20180709223805.GS1392@brightrain.aerifal.cx> <20180710005943.GT1392@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1531235225 4386 195.159.176.226 (10 Jul 2018 15:07:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 10 Jul 2018 15:07:05 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-13027-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jul 10 17:07:00 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1fcuEG-00011T-7R for gllmg-musl@m.gmane.org; Tue, 10 Jul 2018 17:07:00 +0200 Original-Received: (qmail 21711 invoked by uid 550); 10 Jul 2018 15:09:07 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 21693 invoked from network); 10 Jul 2018 15:09:06 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:13011 Archived-At: On Tue, Jul 10, 2018 at 08:05:50AM -0400, Christopher Friedt wrote: > On Mon, Jul 9, 2018, 9:00 PM Rich Felker, wrote: > > > Can you provide a minimized test case (short single C source file) to > > reproduce this, or an strace log of the test that fails? The latter is > > probably actually be better if the behavior is dependent on the Docker > > network configuration. Assuming the test is attempting to lookup and > > bind on "localhost" by name, which is what it appears to be doing > > here: > > > > > > https://github.com/apache/thrift/blob/82ae9575cdc112088771fc7b876f75e1e4d85ebb/lib/cpp/test/TServerSocketTest.cpp > > > > the behavior you're experiencing is not what I expect from musl; > > rather my expectation is that you would get 127.0.0.1 as the first > > result and ::1 as the second, and this is exactly what I see if I do: > > > > ip addr del ::1 dev lo > > > > on my laptop running Alpine, then call getaddrinfo for localhost with > > a small test program. > > > > The logic to sort results does gratuitously depend on v4mapped > > addresses working to do the IPv4 routability probing; if something > > about the configuration suppresses their ability to work, it will > > break. This is a known open issue I want to go back and fix. Seeing > > the strace would show me right away if it's the source of your > > problem, and even if not chances are very good that it would point out > > whatever the cause is. > > > > Strange - yeah, I'll write up a small program in C to demonstrate. OK. Can you also post the results of: strace -o logfile your_test_prog This avoids the need for me or someone else to reproduce the full configuration to see what's going on. strace output is almost certainly the fastest path to a solution. Rich