Merge branch '3840-avoid-libuv-with-broken-recvmmsg-v9_18' into 'v9_18'

[9.18] Avoid libuv 1.35 and 1.36 that have broken recvmmsg implementation

See merge request isc-projects/bind9!7482
This commit is contained in:
Michał Kępień 2023-02-09 21:38:47 +00:00
commit 44c3f4e249
5 changed files with 47 additions and 11 deletions

View file

@ -1,3 +1,9 @@
6094. [bug] Building against (or running with) libuv versions
1.35.0 and 1.36.0 is now a fatal error. The rules for
mixing and matching compile-time and run-time libuv
versions have been tightened for libuv versions between
1.35.0 and 1.40.0. [GL #3840]
6092. [bug] dnssec-cds failed to cleanup properly. [GL #3831]
6089. [bug] Source ports configured for query-source,

View file

@ -541,9 +541,9 @@ AC_CHECK_FUNCS([pthread_setname_np pthread_set_name_np])
AC_CHECK_HEADERS([pthread_np.h], [], [], [#include <pthread.h>])
# libuv
AC_MSG_CHECKING([for libuv])
PKG_CHECK_MODULES([LIBUV], [libuv >= 1.0.0], [],
[AC_MSG_ERROR([libuv not found])])
PKG_CHECK_MODULES([LIBUV], [libuv >= 1.37.0], [],
[PKG_CHECK_MODULES([LIBUV], [libuv >= 1.0.0 libuv < 1.35.0], [],
[AC_MSG_ERROR([libuv >= 1.0.0 (except 1.35.0 and 1.36.0) not found])])])
AX_SAVE_FLAGS([libuv])
CFLAGS="$CFLAGS $LIBUV_CFLAGS"

View file

@ -60,10 +60,12 @@ To build BIND 9, the following packages must be installed:
- ``perl``
- ``pkg-config`` / ``pkgconfig`` / ``pkgconf``
BIND 9.18 requires ``libuv`` 1.x or higher. On older systems, an updated
``libuv`` package needs to be installed from sources such as EPEL, PPA,
or other native sources. The other option is to build and install
``libuv`` from source.
BIND 9.18 requires ``libuv`` 1.0.0 or higher, using ``libuv`` >= 1.40.0
is recommended. Compiling or running with ``libuv`` 1.35.0 or 1.36.0 is
not supported, as this could lead to an assertion failure in the UDP
receive code. On older systems, an updated ``libuv`` package needs to be
installed from sources such as EPEL, PPA, or other native sources. The
other option is to build and install ``libuv`` from source.
OpenSSL 1.0.2e or newer is required. If the OpenSSL library is installed
in a nonstandard location, specify the prefix using

View file

@ -30,7 +30,26 @@ Removed Features
Feature Changes
~~~~~~~~~~~~~~~
- None.
- libuv support for receiving multiple UDP messages in a single system
call (``recvmmsg()``) has been tweaked several times between libuv
versions 1.35.0 and 1.40.0; the recommended libuv version is 1.40.0 or
higher. New rules are now in effect for running with a different
version of libuv than the one used at compilation time. These rules
may trigger a fatal error at startup:
- Building against or running with libuv versions 1.35.0 and 1.36.0 is
now a fatal error.
- Running with libuv version higher than 1.34.2 is now a fatal error
when :iscman:`named` is built against libuv version 1.34.2 or lower.
- Running with libuv version higher than 1.39.0 is now a fatal error
when :iscman:`named` is built against libuv version 1.37.0, 1.38.0,
1.38.1, or 1.39.0.
This prevents the use of libuv versions that may trigger an assertion
failure when receiving multiple UDP messages in a single system call.
:gl:`#3840`
Bug Fixes
~~~~~~~~~

View file

@ -204,10 +204,10 @@ isc__nm_threadpool_initialize(uint32_t workers) {
#elif HAVE_DECL_UV_UDP_MMSG_FREE
#define MINIMAL_UV_VERSION UV_VERSION(1, 40, 0)
#elif HAVE_DECL_UV_UDP_RECVMMSG
#define MAXIMAL_UV_VERSION UV_VERSION(1, 39, 99)
#define MINIMAL_UV_VERSION UV_VERSION(1, 37, 0)
#elif HAVE_DECL_UV_UDP_MMSG_CHUNK
#define MINIMAL_UV_VERSION UV_VERSION(1, 35, 0)
#else
#define MAXIMAL_UV_VERSION UV_VERSION(1, 34, 99)
#define MINIMAL_UV_VERSION UV_VERSION(1, 0, 0)
#endif
@ -218,10 +218,19 @@ isc__netmgr_create(isc_mem_t *mctx, uint32_t workers, isc_nm_t **netmgrp) {
REQUIRE(workers > 0);
#ifdef MAXIMAL_UV_VERSION
if (uv_version() > MAXIMAL_UV_VERSION) {
FATAL_ERROR("libuv version too new: running with libuv %s "
"when compiled with libuv %s will lead to "
"libuv failures",
uv_version_string(), UV_VERSION_STRING);
}
#endif /* MAXIMAL_UV_VERSION */
if (uv_version() < MINIMAL_UV_VERSION) {
FATAL_ERROR("libuv version too old: running with libuv %s "
"when compiled with libuv %s will lead to "
"libuv failures because of unknown flags",
"libuv failures",
uv_version_string(), UV_VERSION_STRING);
}