mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: Satadru Pramanik <satadru@gmail.com>
Cc: musl@lists.openwall.com
Subject: Re: [musl] Re: musl getaddr info breakage on older kernels
Date: Sun, 6 Feb 2022 21:40:57 -0500	[thread overview]
Message-ID: <20220207024056.GY7074@brightrain.aerifal.cx> (raw)
In-Reply-To: <CAFrh3J8Aw-X4TsnOX03=4SXe=kAP0kqF=QvNwOi_jWo9C5D0mA@mail.gmail.com>

On Sun, Feb 06, 2022 at 08:29:16PM -0500, Satadru Pramanik wrote:
> Here are illustrative logs of output and strace logs.
> 
> Note that while the musl toolchain is built in a container on a much more
> powerful machine, this "musl_getaddrinfo_test" app is built locally on the
> machine with the 3.8 kernel.
> 
> I ran the following to get the output on the smaller i686 machine
> immediately after the app is built.
> Apologies for the ruby code wrapping the shell commands.
> 
>     @musl_ver = `#{CREW_MUSL_PREFIX}/lib/libc.so 2>&1 >/dev/null | head -2
> | tail -1 | awk '{print $2}'`.chomp
>     puts 'Testing the musl resolver to see if it can resolve google.com:
> '.lightblue
>     system "./musl_getaddrinfo_test google.com set_ai_family 2>&1 |tee -a
> /tmp/musl_#{@musl_ver}_getaddrinfo_test_google.com_set_ai_family.txt "
>     system "./musl_getaddrinfo_test google.com 2>&1 |tee -a
> /tmp/musl_#{@musl_ver}_getaddrinfo_test_google.com.txt"
>     system "strace -o
> /tmp/musl_#{@musl_ver}_getaddrinfo_test_google.com_set_ai_family_STRACE.txt
> ../musl_getaddrinfo_test google.com set_ai_family"
>     system "strace -o
> /tmp/musl_#{@musl_ver}_getaddrinfo_test_google.com_STRACE.txt
> ../musl_getaddrinfo_test google.com"
> 
> And here is the output for each run before running again via strace. Note
> how IPv6 addresses show up sporadically, and for 1.2.2 nothing at all shows
> up, but everything works fine according to the strace logs. (Strace is
> built against glibc 2.23.)
> 
> ==>
> musl_1.2.0-git-17-g33338ebc_getaddrinfo_test_google.com_set_ai_family.txt
> <==
> AF_INET: 142.251.40.110
> 
> ==> musl_1.2.0-git-17-g33338ebc_getaddrinfo_test_google.com.txt <==
> AF_INET: 142.251.40.110
> 
> ==>
> musl_1.2.0-git-39-g5cf1ac24_getaddrinfo_test_google.com_set_ai_family.txt
> <==
> AF_INET: 142.251.40.142
> 
> ==> musl_1.2.0-git-39-g5cf1ac24_getaddrinfo_test_google.com.txt <==
> getaddrinfo: Try again
> 
> ==>
> musl_1.2.0-git-40-g1b4e84c5_getaddrinfo_test_google.com_set_ai_family.txt
> <==
> AF_INET: 142.251.40.206
> 
> ==> musl_1.2.0-git-40-g1b4e84c5_getaddrinfo_test_google.com.txt <==
> AF_INET6: 2607:f8b0:4006:81f::200e
> AF_INET: 142.251.40.206
> 
> ==>
> musl_1.2.0-git-6-g2f2348c9_getaddrinfo_test_google.com_set_ai_family.txt <==
> AF_INET: 142.250.65.206
> 
> ==> musl_1.2.0-git-6-g2f2348c9_getaddrinfo_test_google.com.txt <==
> AF_INET: 142.250.65.206
> 
> ==> musl_1.2.1_getaddrinfo_test_google.com_set_ai_family.txt <==
> AF_INET: 142.251.40.110
> 
> ==> musl_1.2.1_getaddrinfo_test_google.com.txt <==
> getaddrinfo: Try again
> 
> ==> musl_1.2.2_getaddrinfo_test_google.com_set_ai_family.txt <==
> getaddrinfo: Try again
> 
> ==> musl_1.2.2_getaddrinfo_test_google.com.txt <==
> getaddrinfo: Try again
> 
> Regards,

OK, I don't see anything in the strace suggesting a cause. The kernel
version (or whether a container was used) present on the system where
you built musl or the test programs should make no difference
whatsoever; musl has no build dependencies on the host kernel or
kernel headers or anything like that (and doesn't even need to be
built on a Linux host).

A couple questions:

Are the test programs on the i686 machine running under Docker or any
other container environment?

Can you tcpdump the traffic between the test program and the dnsmasq
during a failing run, with verbose display of the packet contents
(-vvv or something like that)?

I don't see any plausible explanation for the result varying between
runs and with timing like this unless dnsmasq is doing something
odd/wrong. I thought it might be related to something blocking time64
syscalls but that doesn't seem to be the case -- according to the
strace logs they're getting ENOSYS as expected with fallback to the
legacy 32-bit clock_gettime etc. which is fine.

  reply	other threads:[~2022-02-07  2:41 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAFrh3J9CK67S=Jn531zTK04QeR8yiZwro_ZThQD=3aUx5XghCA@mail.gmail.com>
2022-02-06 21:30 ` Rich Felker
2022-02-06 23:25   ` Satadru Pramanik
2022-02-06 23:44     ` Rich Felker
2022-02-07  1:29       ` Satadru Pramanik
2022-02-07  2:40         ` Rich Felker [this message]
2022-02-07 19:19           ` Satadru Pramanik
2022-02-07 21:02             ` Rich Felker
2022-02-14 17:24               ` Satadru Pramanik
2022-02-14 18:29                 ` Rich Felker
2022-02-14 19:00                   ` Satadru Pramanik
2022-02-14 22:00                     ` Rich Felker
2022-02-15 16:59                       ` Satadru Pramanik
2022-02-15 17:44                         ` Rich Felker
2022-02-15 22:56                           ` Satadru Pramanik
2022-02-16  1:41                             ` Rich Felker
2022-02-16 18:37                               ` Satadru Pramanik
2022-02-16 18:44                                 ` Satadru Pramanik
2022-02-16 21:33                                   ` Rich Felker
2022-02-16 21:53                                     ` Satadru Pramanik
2022-02-17  1:44                                       ` Satadru Pramanik
2022-02-17  4:14                                         ` Satadru Pramanik
2022-02-17 13:17                                           ` Satadru Pramanik
2022-02-17 13:24                                             ` Rich Felker
2022-02-17 13:30                                               ` Satadru Pramanik
2022-02-17 13:46                                                 ` Rich Felker
2022-02-17 14:49                                                   ` Satadru Pramanik
2022-02-17 15:53                                                     ` Rich Felker
2022-02-17 16:05                                                       ` Rich Felker
2022-02-17 16:36                                                         ` Satadru Pramanik
2022-02-17 18:17                                                           ` Rich Felker
2022-02-17 21:39                                                             ` Satadru Pramanik
2022-02-17 21:42                                                               ` Satadru Pramanik
     [not found]                                                             ` <CAFrh3J9CBGagzmnn9E7W0H15iiOzZEtg4YKfJ1qRwCtrjnw6tA@mail.gmail.com>
2022-02-17 21:43                                                               ` Fwd: " Satadru Pramanik
2022-02-17 22:48                                                                 ` Rich Felker
2022-02-18  1:25                                                                   ` Satadru Pramanik
2022-02-17 16:17                                                       ` Satadru Pramanik
2022-02-07  5:35     ` Markus Wichmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220207024056.GY7074@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    --cc=satadru@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).