Possible deadlock when shutting down bind
Summary
After some time in use (uptime of several days) bind deadlocks when being shut down by SIGTERM.
BIND version affected
BIND 9.18.24 (Extended Support Version) id: running on FreeBSD amd64 13.3-RELEASE FreeBSD 13.3-RELEASE 80d2b634d GENERIC built by make with '--disable-linux-caps' '--localstatedir=/var' '--sysconfdir=/usr/local/etc/namedb' '--with-dlopen=yes' '--with-libxml2' '--with-openssl=/usr' '--enable-dnsrps' '--with-readline=libedit' '--enable-dnstap' '--disable-fixed-rrset' '--disable-geoip' '--without-maxminddb' '--without-gssapi' '--with-libidn2=/usr/local' '--without-json-c' '--disable-largefile' '--with-lmdb=/usr/local' '--disable-querytrace' '--enable-tcp-fastopen' '--prefix=/usr/local' '--mandir=/usr/local/share/man' '--disable-silent-rules' '--infodir=/usr/local/share/info/' '--build=amd64-portbld-freebsd13.3' 'build_alias=amd64-portbld-freebsd13.3' 'CC=cc' 'CFLAGS=-pipe -march=penryn -DLIBICONV_PLUG -g -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing ' 'LDFLAGS= -fstack-protector-strong ' 'LIBS=-L/usr/local/lib' 'CPPFLAGS=-DLIBICONV_PLUG -isystem /usr/local/include' 'CPP=cpp' 'PKG_CONFIG=pkgconf' 'PKG_CONFIG_LIBDIR=/usr/ports/dns/bind918/work/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig' 'READLINE_CFLAGS=-L/usr/local/lib' compiled by CLANG FreeBSD Clang 17.0.6 (https://github.com/llvm/llvm-project.git llvmorg-17.0.6-0-g6009708b4367) compiled with OpenSSL version: OpenSSL 1.1.1w-freebsd 11 Sep 2023 linked to OpenSSL version: OpenSSL 1.1.1w-freebsd 11 Sep 2023 compiled with libuv version: 1.48.0 linked to libuv version: 1.48.0 compiled with libnghttp2 version: 1.60.0 linked to libnghttp2 version: 1.60.0 compiled with libxml2 version: 2.11.7 linked to libxml2 version: 21107 compiled with zlib version: 1.3.1 linked to zlib version: 1.3.1 compiled with protobuf-c version: 1.4.1 linked to protobuf-c version: 1.4.1 threads support is enabled DNSSEC algorithms: RSASHA1 NSEC3RSASHA1 RSASHA256 RSASHA512 ECDSAP256SHA256 ECDSAP384SHA384 ED25519 ED448 DS algorithms: SHA-1 SHA-256 SHA-384 HMAC algorithms: HMAC-MD5 HMAC-SHA1 HMAC-SHA224 HMAC-SHA256 HMAC-SHA384 HMAC-SHA512 TKEY mode 2 support (Diffie-Hellman): yes TKEY mode 3 support (GSS-API): no
default paths: named configuration: /usr/local/etc/namedb/named.conf rndc configuration: /usr/local/etc/namedb/rndc.conf DNSSEC root key: /usr/local/etc/namedb/bind.keys nsupdate session key: /var/run/named/session.key named PID file: /var/run/named/pid named lock file: /var/run/named/named.lock
Steps to reproduce
After several days working it hangs after a SIGTERM. It requires a KILL or ABRT in order to effectively exit.
Doing a simple truss of the process shows a loop doing nansleep()
What is the current bug behavior?
Hangs up when shutting down
What is the expected correct behavior?
The process should exit
Relevant configuration files
Used as recursive. Nothing special apart from having three views.
Relevant logs
I have an available core file from sending an ABRT when deadlocked.