Re: Issue in bio_dgram_test in OpenSSL 3.2+

RVP <[email protected]> Mon, 27 Jul 2026 08:08:46 +0000 (UTC)
Newsgroups gmane.os.netbsd.general
Message-ID <[email protected]>
On Wed, 22 Jul 2026, Akira Kato wrote:

> While this may not be an issue just for openssl [...]
>

I think it is, actually :(

> It is possible to compile openssl (3.6.3) in pkgsrc, in either 9.4,
> 10.1, or even 11.0RC6. But when you run "make test", it stops in
> "04-test_bio_dgram.t ......................".  Actually bio_dgram_test
> (in test directory) consists of 2 tests.  The first test hungs while
> the second test completes without any issue.
>

This is the large (2 * BIO_CMSG_ALLOC_LEN = 128) recvmmsg() test that's
blocking, and it's caused by

1) small UDP receive buffers on NetBSD:

```
$ sysctl -a | f udp
net.inet.udp.checksum = 1
net.inet.udp.sendspace = 9216
net.inet.udp.recvspace = 41600          	<---
net.inet.udp.do_loopback_cksum = 0
net.inet6.udp6.sendspace = 9216
net.inet6.udp6.recvspace = 42080        	<---
net.inet6.udp6.do_loopback_cksum = 0
```
so not all the messages the program wants to read will be available (some'll
be lost, so you'll _have_ to supply a timeout if you don't want the reader to
block--which OpenSSL doesn't do); and,

2) OpenSSL _not_ adding a timeout for recvmmsg(2) internally in BIO_recvmmsg(3).

> Note that on OpenBSD 7.9 and FreeBSD 14.4, bio_dgram_test successfully
> completed without any error.
>

They probably have larger UDP buffer sizes.

Can you try tripling the buffer sizes?

```
$ sudo sysctl -w net.inet.udp.recvspace=$((41600 * 3))
net.inet.udp.recvspace: 41600 -> 124800

$ sudo sysctl -w net.inet6.udp6.recvspace=$((42080 * 3))
net.inet6.udp6.recvspace: 42080 -> 126240

$
```

-RVP