mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Satadru Pramanik <satadru@gmail.com>
To: Rich Felker <dalias@aerifal.cx>
Cc: musl@lists.openwall.com
Subject: Re: [musl] Re: musl getaddr info breakage on older kernels
Date: Tue, 15 Feb 2022 17:56:53 -0500	[thread overview]
Message-ID: <CAFrh3J9rsT0taq5OoF7gi_jy7JdTzPQcSymT4S5abWyn4qHH_g@mail.gmail.com> (raw)
In-Reply-To: <20220215174420.GL7074@brightrain.aerifal.cx>


[-- Attachment #1.1: Type: text/plain, Size: 1465 bytes --]

>
>
>
> OK, then in that case it's surely Docker's seccomp filters that are
> the problem. I think --security-opt seccomp=unconfined is the part you
> need to work around it.

 That's the command line I was using, which leads to the application NOT
breaking, and thus doesn't allow me to replicate the problem:
 docker run --security-opt seccomp=unconfined  --platform linux/386
--cap-add SYS_PTRACE --rm -v $(pwd)/pkg_cache:/usr/local/tmp/packages -v
$(pwd):/output -h $(hostname)-i686 -it satmandu/crewbuild:alex-i686.m58
/usr/local/bin/setarch i686 sudo -i -u chronos /usr/local/bin/bash -i

The goal with docker was to try to replicate the breakage on the actual
hardware, which is the place we are having this problem.

I ran the process through gdb on the hardware, and stepped through it with
the timeit function from here: https://stackoverflow.com/a/48412363

Of note perhaps is the very long time it takes for some of these calls to
return in gdb? (The program does run in gdb when stepping through the
function, but not when run without the break point)
my commands were in essence the following in gdb:
add symbol table from file "/usr/local/share/musl/lib/libc.so"
break main
run google.com 2>>gdb.out.txt
ti (repeated until the program exited)
(I ran this twice, and both runs succeed with long delays)
Then I ran (this, which fails):
clear main
run google.com 2>>gdb.out.txt

Any other suggestions on how to track down this issue?

Regards,

Satadru

[-- Attachment #1.2: Type: text/html, Size: 2096 bytes --]

[-- Attachment #2: gdb.out.txt --]
[-- Type: text/plain, Size: 5489 bytes --]

Reading symbols from ./musl_getaddrinfo_test...
add symbol table from file "/usr/local/share/musl/lib/libc.so"
Reading symbols from /usr/local/share/musl/lib/libc.so...
Breakpoint 1 at 0x7be: file musl_getaddrinfo_test.c, line 15.
Starting program: /usr/local/tmp/crew/musl_getaddrinfo_test.20220215221133.dir/musl_getaddrinfo_test google.com 2>> gdb.out
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.

Breakpoint 1, main (argc=2, argv=0x7fffecb4) at musl_getaddrinfo_test.c:15
warning: Source file is more recent than executable.
15	        memset(&hints, 0, sizeof(hints));
16	        if (argc > 2)
Call took 0.0342 ms
18	        hints.ai_socktype = SOCK_DGRAM;
Call took 0.0074 ms
20	        r = getaddrinfo(argv[1], NULL, &hints, &result);
Call took 0.0050 ms
0x77f66414 in __kernel_vsyscall ()
Call took 0.4002 ms
Single stepping until exit from function __kernel_vsyscall,
which has no line number information.
main (argc=2, argv=0x7fffecb4) at musl_getaddrinfo_test.c:21
21	        if (r != 0) {
Call took 11.8751 ms
26	        for (rp = result; rp != NULL; rp = rp->ai_next) {
Call took 0.0070 ms
27	            switch (rp->ai_family) {
Call took 0.0073 ms
35	*)rp->ai_addr)->sin6_addr, s, INET6_ADDRSTRLEN);
Call took 0.0085 ms
34	                inet_ntop(AF_INET6, &((struct sockaddr_in6
Call took 0.0057 ms
36	                printf("AF_INET6: %s\n", s);
Call took 3.1300 ms
0x77f66414 in __kernel_vsyscall ()
Call took 0.6778 ms
Single stepping until exit from function __kernel_vsyscall,
which has no line number information.
main (argc=2, argv=0x7fffecb4) at musl_getaddrinfo_test.c:37
37	                break;
Call took 0.1246 ms
26	        for (rp = result; rp != NULL; rp = rp->ai_next) {
Call took 0.0046 ms
27	            switch (rp->ai_family) {
Call took 0.0076 ms
30	*)rp->ai_addr)->sin_addr, s, INET6_ADDRSTRLEN);
Call took 0.0049 ms
29	                inet_ntop(AF_INET, &((struct sockaddr_in
Call took 0.0054 ms
31	                printf("AF_INET: %s\n", s);
Call took 1.3367 ms
0x77f66414 in __kernel_vsyscall ()
Call took 0.6217 ms
Single stepping until exit from function __kernel_vsyscall,
which has no line number information.
main (argc=2, argv=0x7fffecb4) at musl_getaddrinfo_test.c:32
32	                break;
Call took 0.1150 ms
26	        for (rp = result; rp != NULL; rp = rp->ai_next) {
Call took 0.0031 ms
41	        freeaddrinfo(result);
Call took 0.0067 ms
42	    }
Call took 0.2755 ms
0x555556e0 in __do_global_dtors_aux ()
Call took 0.3166 ms
Single stepping until exit from function __do_global_dtors_aux,
which has no line number information.
[Inferior 1 (process 23325) exited normally]
Call took 0.0374 ms
Starting program: /usr/local/tmp/crew/musl_getaddrinfo_test.20220215221133.dir/musl_getaddrinfo_test google.com 2>> gdb.out
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.

Breakpoint 1, main (argc=2, argv=0x7fffecb4) at musl_getaddrinfo_test.c:15
15	        memset(&hints, 0, sizeof(hints));
16	        if (argc > 2)
Call took 0.0387 ms
18	        hints.ai_socktype = SOCK_DGRAM;
Call took 0.0063 ms
20	        r = getaddrinfo(argv[1], NULL, &hints, &result);
Call took 0.0051 ms
0x77f66414 in __kernel_vsyscall ()
Call took 0.4215 ms
Single stepping until exit from function __kernel_vsyscall,
which has no line number information.
main (argc=2, argv=0x7fffecb4) at musl_getaddrinfo_test.c:21
21	        if (r != 0) {
Call took 12.0090 ms
26	        for (rp = result; rp != NULL; rp = rp->ai_next) {
Call took 0.0070 ms
27	            switch (rp->ai_family) {
Call took 0.0112 ms
35	*)rp->ai_addr)->sin6_addr, s, INET6_ADDRSTRLEN);
Call took 0.0071 ms
34	                inet_ntop(AF_INET6, &((struct sockaddr_in6
Call took 0.0075 ms
36	                printf("AF_INET6: %s\n", s);
Call took 3.2155 ms
0x77f66414 in __kernel_vsyscall ()
Call took 0.6847 ms
Single stepping until exit from function __kernel_vsyscall,
which has no line number information.
main (argc=2, argv=0x7fffecb4) at musl_getaddrinfo_test.c:37
37	                break;
Call took 0.1380 ms
26	        for (rp = result; rp != NULL; rp = rp->ai_next) {
Call took 0.0055 ms
27	            switch (rp->ai_family) {
Call took 0.0109 ms
30	*)rp->ai_addr)->sin_addr, s, INET6_ADDRSTRLEN);
Call took 0.0115 ms
29	                inet_ntop(AF_INET, &((struct sockaddr_in
Call took 0.0078 ms
31	                printf("AF_INET: %s\n", s);
Call took 1.3403 ms
0x77f66414 in __kernel_vsyscall ()
Call took 0.6378 ms
Single stepping until exit from function __kernel_vsyscall,
which has no line number information.
main (argc=2, argv=0x7fffecb4) at musl_getaddrinfo_test.c:32
32	                break;
Call took 0.0897 ms
26	        for (rp = result; rp != NULL; rp = rp->ai_next) {
Call took 0.0047 ms
41	        freeaddrinfo(result);
Call took 0.0085 ms
42	    }
Call took 0.2994 ms
0x555556e0 in __do_global_dtors_aux ()
Call took 0.3179 ms
Single stepping until exit from function __do_global_dtors_aux,
which has no line number information.
[Inferior 1 (process 23422) exited normally]
Call took 0.0414 ms
Deleted breakpoint 1 
Starting program: /usr/local/tmp/crew/musl_getaddrinfo_test.20220215221133.dir/musl_getaddrinfo_test google.com 2>> gdb.out
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
getaddrinfo: Try again
[Inferior 1 (process 23511) exited with code 01]

  reply	other threads:[~2022-02-15 22:57 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
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 [this message]
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=CAFrh3J9rsT0taq5OoF7gi_jy7JdTzPQcSymT4S5abWyn4qHH_g@mail.gmail.com \
    --to=satadru@gmail.com \
    --cc=dalias@aerifal.cx \
    --cc=musl@lists.openwall.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).