NetBSD Problem Report #59982
From spz@serpens.de Sun Feb 8 16:06:23 2026
Return-Path: <spz@serpens.de>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
client-signature RSA-PSS (2048 bits) client-digest SHA256)
(Client CN "mail.netbsd.org", Issuer "R13" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id 4D9831A923D
for <gnats-bugs@gnats.NetBSD.org>; Sun, 8 Feb 2026 16:06:23 +0000 (UTC)
Message-Id: <20260208160126.F00A973330@serpens.de>
Date: Sun, 08 Feb 2026 17:01:24 +0100 (MET)
From: spz@serpens.de
Reply-To: spz@serpens.de
To: gnats-bugs@NetBSD.org
Subject: named assertion failure when doing zone transfer
X-Send-Pr-Version: 3.95
X-From4GNATS: "spz@serpens.de via gnats" <gnats-admin@NetBSD.org>
>Number: 59982
>Category: bin
>Synopsis: named assertion failure when doing zone transfer
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Feb 08 16:10:00 +0000 2026
>Last-Modified: Sat Nov 14 07:55:01 +0000 2026
>Originator: S.P.Zeidler
>Release: NetBSD 11.0_RC1
>Organization:
dis-
>Environment:
System: NetBSD serpens.de 11.0_RC1 NetBSD 11.0_RC1 (SERPENS) #0: Sat Feb 7 12:30:40 UTC 2026 root@aries.NetBSD.de:/home/netbsd/11/arch/amiga/obj/sys/arch/amiga/compile/SERPENS amiga
Architecture: m68k
Machine: amiga
>Description:
named.log (with some linebreaks inserted for long lines):
08-Feb-2026 16:40:26.415 zone 192-27.217.233.199.in-addr.arpa/IN: Transfer
started.
08-Feb-2026 16:40:26.643 0xfd08010: transfer of
'192-27.217.233.199.in-addr.arpa/IN' from 199.233.217.200#53: connected
using 199.233.217.200#53
08-Feb-2026 16:40:27.102
/home/netbsd/11/src/external/mpl/bind/lib/libdns/../../dist/lib/dns/zone.c:17927:
INSIST(((({ { int _ret = __libc_mutex_lock(&(zone)->atomic_lock); if
((_ret) != 0) { { char strerr[128]; isc_string_strerror_r(_ret, strerr,
sizeof(strerr));
isc_error_fatal("/home/netbsd/11/src/external/mpl/bind/lib/libdns/../../dist/lib/dns/zone.c",
17927, __func__, "%s()" ": %s (%d)","pthread_mutex_lock", strerr, _ret);
}; }; }; uint64_t x = (zone)->flags; { int _ret =
__libc_mutex_unlock(&(zone)->atomic_lock); if ((_ret) != 0) { { char
strerr[128]; isc_string_strerror_r(_ret, strerr, sizeof(strerr));
isc_error_fatal("/home/netbsd/11/src/external/mpl/bind/lib/libdns/../../dist/lib/dns/zone.c",
17927, __func__, "%s()" ": %s (%d)","pthread_mutex_unlock", strerr, _ret);
}; }; }; x; }) & (DNS_ZONEFLG_REFRESH)) != 0)) failed
08-Feb-2026 16:40:29.071 0xe3c4858 <isc_backtrace_log+0x30> at
/usr/lib/libisc.so.23
08-Feb-2026 16:40:29.098 0x2840a <_init+0xd68e> at /usr/sbin/named
08-Feb-2026 16:40:29.118 0xe3cc3b2 <isc_assertion_failed+0x26> at
/usr/lib/libisc.so.23
08-Feb-2026 16:40:29.141 0xe1af1ac <dns_zone_dump+0x26e4> at
/usr/lib/libdns.so.23
08-Feb-2026 16:40:29.162 0xe1dae4a <dns_zone_import_skr+0x1e2> at
/usr/lib/libdns.so.23
08-Feb-2026 16:40:29.183 0xe1dcc3c <dns_xfrin_detach+0x3a2> at
/usr/lib/libdns.so.23
08-Feb-2026 16:40:29.206 0xe1de1c0 <dns_xfrin_shutdown+0x124e> at
/usr/lib/libdns.so.23
08-Feb-2026 16:40:29.231 0xe22d06a <dns_dispentry_detach+0x15e> at
/usr/lib/libdns.so.23
08-Feb-2026 16:40:29.254 0xe22e86c <dns_dispatch_gettcp+0x836> at
/usr/lib/libdns.so.23
08-Feb-2026 16:40:29.275 0xe3a9b80 <isc_quota_destroy+0xc82> at
/usr/lib/libisc.so.23
08-Feb-2026 16:40:29.299 0xe3a9688 <isc_quota_destroy+0x78a> at
/usr/lib/libisc.so.23
08-Feb-2026 16:40:29.322 0xe3aa0b8 <isc_quota_destroy+0x11ba> at
/usr/lib/libisc.so.23
08-Feb-2026 16:40:29.343 0xe3b4d60 <isc__nm_readcb+0xd0> at
/usr/lib/libisc.so.23
08-Feb-2026 16:40:29.366 0xe3a80f4 <isc__nm_tcp_read_cb+0x15e> at
/usr/lib/libisc.so.23
08-Feb-2026 16:40:29.388 0xe3d3e74 <isc_error_fatal+0x7656> at
/usr/lib/libisc.so.23
08-Feb-2026 16:40:29.411 0xe3d4830 <isc_error_fatal+0x8012> at
/usr/lib/libisc.so.23
08-Feb-2026 16:40:29.432 0xe3d13e2 <isc_error_fatal+0x4bc4> at
/usr/lib/libisc.so.23
08-Feb-2026 16:40:29.455 0xe3d80b8 <isc_error_fatal+0xb89a> at
/usr/lib/libisc.so.23
08-Feb-2026 16:40:29.476 0xe3c525c <isc_signal_start+0x71a> at
/usr/lib/libisc.so.23
08-Feb-2026 16:40:29.504 0xe3c60ea <isc_loopmgr_run+0x170> at
/usr/lib/libisc.so.23
08-Feb-2026 16:40:29.525 0x6b122 <uv__server_io+0xb7ca> at /usr/sbin/named
08-Feb-2026 16:40:29.545 0x1fe7c <_init+0x5100> at /usr/sbin/named
08-Feb-2026 16:40:29.569 exiting (due to assertion failure)
I've seen this both times I started named, within minutes of start.
Since named needs to run, going to use pkgsrc bind for the time being.
>How-To-Repeat:
zone transfer seems to be broken at least on amiga
>Fix:
>Audit-Trail:
From: Showta Ishizaki <zakinko@snowrabbit.org>
To: gnats-bugs@NetBSD.org
Cc: zakinko@snowrabbit.org
Subject: Re: bin/59982: named assertion failure when doing zone transfer
Date: Sat, 14 Nov 2026 16:51:08 +0900 (JST)
A friend's NetBSD 11.1/i386 secondary hit this too, at the start of
the first zone transfer after named came up:
zone.c:18055: INSIST(((({ ... uint64_t x = (zone)->flags; ... x; })
& (DNS_ZONEFLG_REFRESH)) != 0)) failed
On _ILP32 the zone flags are kept in a plain uint64_t under
zone->atomic_lock, and ISC_ZONE_SET() and ISC_ZONE_CLR() compute the
new value but never store it back:
uint64_t x = ((z)->f | (o));
So DNS_ZONE_SETFLAG(), DNS_ZONE_SETOPTION() and the others do nothing
on 32-bit ports. zone_refresh() sets DNS_ZONEFLG_REFRESH, the flag is
still clear when the transfer finishes, and zone_xfrdone() trips the
INSIST. DNS_ZONEFLG_NEEDNOTIFY is never set either, which looks like
bin/60833. ISC_QP_ADD() in qp.c has the same shape, so the qp-trie
timing counters stay at zero.
The diff below stores the result and returns the old value, the same
as atomic_fetch_or()/atomic_fetch_and(). It applies to -current and to
netbsd-11.
I tested it under qemu on NetBSD 11.0/i386, 11.1/i386 and
11.1/evbarm-earmv7hf, with a primary and a secondary named on one
machine. On all three the stock named crashes on the first transfer
and its primary sends no NOTIFY, and the same libdns rebuilt from
source without the diff behaves the same way. With only libdns
replaced by a patched build, the transfer completes, NOTIFY from the
primary reaches the secondary, and the secondary fetches the new
serial. I have no m68k machine to try it on, but the code is not
machine dependent.
Index: external/mpl/bind/dist/lib/dns/qp.c
--- external/mpl/bind/dist/lib/dns/qp.c
+++ external/mpl/bind/dist/lib/dns/qp.c
@@ -77,7 +77,8 @@ static isc_mutex_t qp_mutex = PTHREAD_MUTEX_INITIALIZER;
#define ISC_QP_ADD(v, a) \
({ \
isc_mutex_lock(&qp_mutex); \
- uint64_t x = (v) + (a); \
+ uint64_t x = (v); \
+ (v) = x + (a); \
isc_mutex_unlock(&qp_mutex); \
x; \
})
Index: external/mpl/bind/dist/lib/dns/zone.c
--- external/mpl/bind/dist/lib/dns/zone.c
+++ external/mpl/bind/dist/lib/dns/zone.c
@@ -543,14 +543,16 @@ struct dns_zone {
#define ISC_ZONE_SET(z, f, o) \
({ \
isc_mutex_lock(&(z)->atomic_lock); \
- uint64_t x = ((z)->f | (o)); \
+ uint64_t x = (z)->f; \
+ (z)->f = x | (o); \
isc_mutex_unlock(&(z)->atomic_lock); \
x; \
})
#define ISC_ZONE_CLR(z, f, o) \
({ \
isc_mutex_lock(&(z)->atomic_lock); \
- uint64_t x = ((z)->f & ~(o)); \
+ uint64_t x = (z)->f; \
+ (z)->f = x & ~(o); \
isc_mutex_unlock(&(z)->atomic_lock); \
x; \
})
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.