Message ID | 20211028230131.5f50d6e7@gmx.net |
---|---|
State | Superseded |
Headers | show |
Series | [uclibc-ng-devel] Re: [Buildroot] [PATCH v1] package/ntpsec: new package | expand |
Hi Peter, Peter Seiderer wrote, > Hello Waldemar, *, > > On Mon, 25 Oct 2021 23:25:41 +0200, Peter Seiderer <ps.report@gmx.net> wrote: > > The resulting ntpd runs fine with the raspberrypi3_defconfig, but segfaults > when compiled/used with raspberrypi3_64_defconfig (uclibc, -Os): > > $ /usr/sbin/ntpd -n -d -g > 1970-01-01T00:04:18 ntpd[263]: INIT: ntpd ntpsec-1.2.0 2021-10-24T13:39:21Z: Starting > 1970-01-01T00:04:18 ntpd[263]: INIT: Command line: /usr/sbin/ntpd -n -d > 1970-01-01T00:04:18 ntpd[263]: INIT: precision = 7.291 usec (-17) > 1970-01-01T00:04:18 ntpd[263]: INIT: successfully locked into RAM > 1970-01-01T00:04:18 ntpd[263]: CONFIG: readconfig: parsing file: /etc/ntp.conf > 1970-01-01T00:04:18 ntpd[263]: CONFIG: restrict nopeer ignored > 1970-01-01T00:04:18 ntpd[263]: INIT: Using SO_TIMESTAMPNS > 1970-01-01T00:04:18 ntpd[263]: IO: Listen and drop on 0 v6wildcard [::]:123 > 1970-01-01T00:04:18 ntpd[263]: IO: Listen and drop on 1 v4wildcard 0.0.0.0:123 > 1970-01-01T00:04:18 ntpd[263]: IO: Listen normally on 2 lo 127.0.0.1:123 > 1970-01-01T00:04:18 ntpd[263]: IO: Listen normally on 3 eth0 172.16.0.30:123 > 1970-01-01T00:04:18 ntpd[263]: IO: Listen normally on 4 lo [::1]:123 > 1970-01-01T00:04:18 ntpd[263]: IO: Listen normally on 5 eth0 [fe80::ba27:ebff:fea6:340%2]:123 > 1970-01-01T00:04:18 ntpd[263]: IO: Listening on routing socket on fd #22 for interface updates > 1970-01-01T00:04:19 ntpd[263]: SYNC: Found 10 servers, suggest minsane at least 3 > 1970-01-01T00:04:19 ntpd[263]: INIT: MRU 10922 entries, 13 hash bits, 65536 bytes > 1970-01-01T00:04:20 ntpd[263]: DNS: dns_probe: 0.pool.ntp.org, cast_flags:8, flags:101 > Segmentation fault (core dumped) Could you add a small C test program to uClibc-ng-test to trigger the bug? That would help to find any regression to targets without TLS support. best regards Waldemar
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index 8bbd7c7..cf170fb 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -3344,7 +3344,7 @@ libc_hidden_def(dn_skipname) /* Will be called under __resolv_lock. */ static void res_sync_func(void) { - struct __res_state *rp = &(_res); + struct __res_state *rp = __res_state(); int n; /* If we didn't get malloc failure earlier... */ @@ -3896,7 +3896,7 @@ res_ninit(res_state statp) #endif /* L_res_init */ #ifdef L_res_state -# if defined __UCLIBC_HAS_TLS__ +# if !defined __UCLIBC_HAS_TLS__ struct __res_state * __res_state (void) {