Re: [chrony-users] FreeBSD socket.test FAIL: recvmsg() error EAGAIN on accept TCP socket receive

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-users Archives ]


Am 28.08.25 um 10:07 schrieb Miroslav Lichvar:
On Wed, Aug 27, 2025 at 04:50:36PM +0200, Matthias Andree wrote:
chrony 4.7 and 4.8 (and possibly others) have an issue with
test/util/socket.c's self test,
UNLESS running under "truss" (think strace in the Linux world).

Apparently we're looking at OS-specific differences WRT non-blocking
accept()ed sockets for TCP between FreeBSD and, say, Linux, or with
something that a syscall tracer will cause to be retried.
I have a FreeBSD 14.2 VM that I use for testing and it wasn't failing
for me. Maybe it's too slow.

Debugging this, SCK_AcceptConnection unconditionally sets O_NONBLOCK on the
socket,
It should be now fixed in git. Thanks for the report.

Miroslav,

thanks for the prompt reply. I  confirm the fix works for us and have pushed it to the FreeBSD ports repository.

Speaking of which, configure states that FreeBSD 11.0 had a broken
recvmmsg() - have there been bug reports at the time or fixes? Have we
retried this on 13.5, 14.2, 14.3? What do we need to look for?
That bug was fixed, but it seems it's still just a loop around
recvmsg, not a single system call, which means there is an extra
system call made and I'm not sure if it's worth it.

https://github.com/freebsd/freebsd-src/blob/main/lib/libsys/recvmmsg.c#L80

OK, then indeed we can just talk recvmsg directly if it's not better.

Regards,
Matthias



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/