Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Apr 2023 05:42:54 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        peter@rulingia.com, Current FreeBSD <freebsd-current@freebsd.org>
Subject:   Re: ntpd fails on recent -current/arm64
Message-ID:  <A9509263-170B-44C7-8684-3770D08C41E2@yahoo.com>
In-Reply-To: <A34D6EAC-742F-4560-9F1A-F7519444268C@yahoo.com>
References:  <A34D6EAC-742F-4560-9F1A-F7519444268C@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Apr 23, 2023, at 05:29, Mark Millard <marklmi@yahoo.com> wrote:

> Peter Jeremy <peter_at_rulingia.com> write on
> Date: Sun, 23 Apr 2023 11:47:01 UTC :
>=20
>> Somewhere between c283016-g607bc91d90a3 and c283077-g7f658f99f7ed,
>=20
> I see the problem at main-n262371-72ef722b2a34-dirty (aarch64),
> in the middle of your range. So in the smaller range is:
>=20
> Thu, 20 Apr 2023
> . . .
>    =E2=80=A2 git: 607bc91d90a3 - main - vmrun.sh: Fix a typo in =
usage() Mateusz Piotrowski=20
>    =E2=80=A2 Re: git: 373b95976bce - main - netstat: document that PCB =
information can't be read from corefiles tuexen_at_freebsd.org
>    =E2=80=A2 git: de1dde5dfea4 - main - network.subr: adjust regex for =
wlans_xxxxx rc.conf entries Bjoern A. Zeeb
>    =E2=80=A2 Re: git: 8dcf3a82c54c - main - libc: Implement bsort(3) a =
bitonic type of sorting algorithm. Brooks Davis=20
>    =E2=80=A2 git: 7db7bfe1a7b9 - main - iwlwifi: quieten more compiler =
warnings Bjoern A. Zeeb
>    =E2=80=A2 git: 35f7fa4ac1ae - main - LinuxKPI: 802.11: improve =
assertion and tkip code Bjoern A. Zeeb
>    =E2=80=A2 git: fdb987bebddf - main - inpcb: Split PCB hash tables =
Mark Johnston=20
>    =E2=80=A2 git: 3e98dcb3d574 - main - inpcb: Move inpcb matching =
logic into separate functions Mark Johnston=20
>    =E2=80=A2 git: 7b92493ab1d4 - main - inpcb: Avoid inp_cred =
dereferences in SMR-protected lookup Mark Johnston=20
>    =E2=80=A2 git: 5fd1a67e885e - main - inpcb: Release the inpcb cred =
reference before freeing the structure Mark Johnston=20
>    =E2=80=A2 git: dd9059b3e9a1 - main - makefs: set cd9660 Rock Ridge =
timestamps for . and .. Ed Maste=20
>    =E2=80=A2 git: 0df4d8ad7a1b - main - Add jobs.mk to allow for =
target-jobs Simon J. Gerraty
>    =E2=80=A2 git: d1f4c44aa8af - main - x86: Move i386 ppireg.h to x86 =
Dmitry Chagin=20
>    =E2=80=A2 git: de4da6cd04bf - main - x86: Move i386 timerreg.h to =
x86 Dmitry Chagin=20
>    =E2=80=A2 git: 8fe4f8f7a75f - main - Fix building host tools for =
host Simon J. Gerraty
>    =E2=80=A2 git: bb8e8e230d94 - main - Revert "libc: Implement =
bsort(3) a bitonic type of sorting algorithm." Hans Petter Selasky=20
>    =E2=80=A2 Re: git: bb8e8e230d94 - main - Revert "libc: Implement =
bsort(3) a bitonic type of sorting algorithm." Jessica Clarke=20
>    =E2=80=A2 Re: git: bb8e8e230d94 - main - Revert "libc: Implement =
bsort(3) a bitonic type of sorting algorithm." Brooks Davis=20
>    =E2=80=A2 git: 1a149d65baed - main - dtrace: get rid of uchar_t =
types Mark Johnston=20
>    =E2=80=A2 git: 080e56a6c98c - main - dtrace: expose =
dtrace_instr_size() to userland and implement it for riscv Mark Johnston=20=

>    =E2=80=A2 git: 75081b9ed8e6 - main - dtrace: use =
dtrace_instr_size() in the riscv dtrace_subr.c Mark Johnston=20
>    =E2=80=A2 git: 1fef7abdc76b - main - dtrace: add register bindings =
for RISC-V Mark Johnston=20
>    =E2=80=A2 Re: git: bb8e8e230d94 - main - Revert "libc: Implement =
bsort(3) a bitonic type of sorting algorithm." Hans Petter Selasky=20
>    =E2=80=A2 Re: git: bb8e8e230d94 - main - Revert "libc: Implement =
bsort(3) a bitonic type of sorting algorithm." Hans Petter Selasky=20
>    =E2=80=A2 git: 47e888f8363d - main - Remove a few more references =
to riscv64sf. John Baldwin=20
>    =E2=80=A2 git: 048606bec11f - main - perfmon(4): Use a C89 function =
definition for a SYSINIT. John Baldwin=20
>    =E2=80=A2 git: bf043855213c - main - arm: Use C89 function =
declaration for db_read_bytes. John Baldwin=20
>    =E2=80=A2 Re: git: c1e813d12309 - main - hwpmc: Correct selection =
of Intel fixed counters. Alexander Motin=20
>    =E2=80=A2 git: 72ef722b2a34 - main - dpaa2: add console support for =
FDT based systems Bjoern A. Zeeb
> . . .
>=20
>> some change in the kernel has made ntpd stop working on my arm64 test
>> box. (My amd64 test box is a couple of days behind so I'm not sure if
>> it's arm-specific).
>>=20
>> What I've identified so far:
>> * The problem is in the kernel, not userland.
>=20
> See below for the truss output oddity of doing
> 2 sendto's (no recvfrom) instead of sendto then
> recvfrom. =46rom an machine with an older context
> that works:
>=20
> . . .
> socket(PF_INET,SOCK_DGRAM,IPPROTO_UDP) =3D 3 (0x3)
> connect(3,{ AF_INET 127.0.0.1:123 },16) =3D 0 (0x0)
> sendto(3,"\^V\^A\0\^A\0\0\0\0\0\0\0\0",12,0,NULL,0) =3D 12 (0xc)
> select(4,{ 3 },0x0,0x0,{ 5.000000 }) =3D 1 (0x1)
> recvfrom(3,"\^V\M^A\0\^A\^F\^X\0\0\0\0\0\^X"...,516,0,NULL,0x0) =3D 36 =
(0x24)
> fstat(1,{ mode=3Dcrw--w---- ,inode=3D138,size=3D0,blksize=3D4096 }) =3D =
0 (0x0)
> ioctl(1,TIOCGETA,0x735a71d98c58) =3D 0 (0x0)
>=20
>>=20
>> * The impact seems to be limited to ntpd (in particular, ntpdate =
works).
>> * ntpd appears to be correctly exchanging NTP packets with peers.
>> * ntpd is not responding to "ntpq -p" queries
>=20
> I noticed that "ntpq -c as" end up doing:
>=20
> . . .
> open("/etc/services",O_RDONLY|O_CLOEXEC,0666) =3D 3 (0x3)
> fstat(3,{ mode=3D-rw-r--r-- ,inode=3D14579,size=3D72600,blksize=3D72704 =
}) =3D 0 (0x0)
> lseek(3,0x0,SEEK_CUR) =3D 0 (0x0)
> lseek(3,0x0,SEEK_SET) =3D 0 (0x0)
> read(3,"#\n# Network services, Internet "...,72704) =3D 72600 =
(0x11b98)
> close(3) =3D 0 (0x0)
> socket(PF_INET,SOCK_DGRAM,IPPROTO_UDP) =3D 3 (0x3)
> connect(3,{ AF_INET 127.0.0.1:123 },16) =3D 0 (0x0)
> sendto(3,"\^V\^A\0\^A\0\0\0\0\0\0\0\0",12,0,NULL,0) =3D 12 (0xc)
> select(4,{ 3 },0x0,0x0,{ 5.000000 }) =3D 0 (0x0)
> sendto(3,"\^V\^A\0\^A\0\0\0\0\0\0\0\0",12,0,NULL,0) =3D 12 (0xc)
> select(4,{ 3 },0x0,0x0,{ 5.000000 }) =3D 0 (0x0)
> localhost: timed out, nothing received
> write(2,"localhost: timed out, nothing re"...,39) =3D 39 (0x27)
> ***Request timed out
> write(2,"***Request timed out\n",21) =3D 21 (0x15)
> exit(0x0) process exit, rval =3D 0

I should not have written:
> Note the: socket(PF_INET,SOCK_DGRAM,IPPROTO_UDP) =3D 3 (0x3)
>=20
> I've no use of PF set up.

It just confuses things because the older context also
makes that call. It is really what follows (sendto->sendto
vs. sendto->recvfrom) that matters from what I can tell.

Sorry for the misdirection.

> Your "ntpq -p" also gets such:
>=20
> socket(PF_INET,SOCK_DGRAM,IPPROTO_UDP) =3D 3 (0x3)
> connect(3,{ AF_INET 127.0.0.1:123 },16) =3D 0 (0x0)
> sendto(3,"\^V\^A\0\^A\0\0\0\0\0\0\0\0",12,0,NULL,0) =3D 12 (0xc)
> select(4,{ 3 },0x0,0x0,{ 5.000000 }) =3D 0 (0x0)
> sendto(3,"\^V\^A\0\^A\0\0\0\0\0\0\0\0",12,0,NULL,0) =3D 12 (0xc)
> select(4,{ 3 },0x0,0x0,{ 5.000000 }) =3D 0 (0x0)
> localhost: timed out, nothing received
> write(2,"localhost: timed out, nothing re"...,39) =3D 39 (0x27)
> ***Request timed out
> write(2,"***Request timed out\n",21) =3D 21 (0x15)
> exit(0x0) process exit, rval =3D 0
>=20
>=20
>=20
>> * ntp_gettime and ntp_adjtime both return TIME_ERROR to ntptime
>>=20
>> I've looked through the commits and, beyond much of netinet being
>> roto-tilled, I can't see anything obvious.
>>=20
>> Is anyone else seeing anything similar?
>=20
> Yes. I noticed via systems without a RTC that I'd set up
> to have ntpd fix the times on. The times stopped being
> fixed.
>=20
>> Can anyone suggest where
>> to look next?
>=20
> See the truss output above? (I'm no expert in the area.
> I'm just noting the odd sendto sendto sequence without
> any recvfrom.)
>=20


=3D=3D=3D
Mark Millard
marklmi at yahoo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A9509263-170B-44C7-8684-3770D08C41E2>