NetBSD Problem Report #60925
From oster@fween.ca Sun Oct 25 21:21:53 2026
Return-Path: <oster@fween.ca>
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 "YR1" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id D90411A923B
for <gnats-bugs@gnats.NetBSD.org>; Sun, 25 Oct 2026 21:21:53 +0000 (UTC)
Message-Id: <20261025211430.432A93775B9@pepe.fween.ca>
Date: Sun, 25 Oct 2026 15:14:30 -0600 (CST)
From: oster@netbsd.org
Reply-To: oster@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: named and cmake dump core in 10.2_STABLE amd64 after pthread_atfork.c changes
X-Send-Pr-Version: 3.95
X-From4GNATS: "oster@netbsd.org via gnats" <gnats-admin@NetBSD.org>
>Number: 60925
>Category: lib
>Synopsis: named and cmake dump core in 10.2_STABLE amd64 after pthread_atfork.c changes
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: martin
>State: analyzed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Oct 25 21:25:00 +0000 2026
>Closed-Date:
>Last-Modified: Mon Oct 26 03:32:50 +0000 2026
>Originator: Greg Oster
>Release: NetBSD 10.2_STABLE
>Organization:
>Environment:
System: NetBSD pepe 10.1_STABLE NetBSD 10.1_STABLE (GENERIC) #0: Mon Sep 7 09:22:42 CST 2026 oster@gonzo:/u1/builds/build451/src/obj/amd64/u1/builds/build451/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
With today's NetBSD 10.2_STABLE checkout, cmake dumps core when running the bootstrap version
of cmake when trying to build cmake in pkgsrc. The stack trace looks, in part, like:
#0 0x000076728c57f79a in _lwp_kill () from /usr/lib/libc.so.12
#1 0x000076728c584fa0 in abort () from /usr/lib/libc.so.12
#2 0x000076728e2220fa in uv__signal_global_init () at src/unix/signal.c:73
#3 0x000076728bc07cb6 in pthread_once () from /usr/lib/libpthread.so.1
#4 0x000076728e21dc0b in uv_once (guard=guard@entry=0x76728e42cb00 <uv.signal_global_init_guard>,
callback=callback@entry=0x76728e21a99d <uv__signal_global_init>) at src/unix/thread.c:454
#5 0x000076728e21aa1c in uv__signal_global_once_init () at src/unix/signal.c:111
#6 0x000076728e216d8a in uv_loop_init (loop=0x76728eca8000) at src/unix/loop.c:83
#7 0x00000000e078dcd1 in cmUVProcessChain::InternalData::Prepare(cmUVProcessChainBuilder const*) ()
...
Within the same environment, named also dumps core, with the following stack trace:
Program terminated with signal SIGABRT, Aborted.
#0 0x000071db8af7f79a in _lwp_kill () from /usr/lib/libc.so.12
(gdb) where
#0 0x000071db8af7f79a in _lwp_kill () from /usr/lib/libc.so.12
#1 0x000071db8af84fa0 in abort () from /usr/lib/libc.so.12
#2 0x000071db9046d115 in ?? () from /usr/lib/libisc.so.21
#3 0x000071db8ec07cb6 in pthread_once () from /usr/lib/libpthread.so.1
#4 0x000071db90464e55 in uv_once () from /usr/lib/libisc.so.21
#5 0x000071db9045c26d in uv_loop_init () from /usr/lib/libisc.so.21
#6 0x000071db9043604d in isc.netmgr_create () from /usr/lib/libisc.so.21
#7 0x000071db904229b8 in isc_managers_create () from /usr/lib/libisc.so.21
#8 0x0000000095a666f2 in main ()
(gdb)
This is replicated both on a full 10.2_STABLE install in userland (for named) on two
separate hosts, and in a 10.2_STABLE chroot (both with 10.1_STABLE and 10.2_STABLE kernels) for cmake.
>How-To-Repeat:
Upgrade from 10.1_STABLE to today's 10.2_STABLE. Run '/etc/rc.d/named onestart'. Watch named fail to start
and dump core (if enabled). Attempt to compile /usr/pkgsrc/devel/cmake in a 10.2_STABLE virtual environment.
Watch it also fail and dump core.
Note that the problem does not exist in the official 10.2 release. It is only in 10.2_STABLE.
>Fix:
Reverting this commit:
cvs rdiff -u -r1.17 -r1.17.2.1 src/lib/libc/gen/pthread_atfork.c
gets things working for me. But no idea as to the underlying issue.
>Release-Note:
>Audit-Trail:
From: mlelstv@serpens.de (Michael van Elst)
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: lib/60925: named and cmake dump core in 10.2_STABLE amd64 after pthread_atfork.c changes
Date: Sun, 25 Oct 2026 23:44:25 -0000 (UTC)
gnats-admin@NetBSD.org ("oster@netbsd.org via gnats") writes:
> Reverting this commit:
>cvs rdiff -u -r1.17 -r1.17.2.1 src/lib/libc/gen/pthread_atfork.c
>gets things working for me. But no idea as to the underlying issue.
- return malloc(sizeof(atfork_builtin));
+ rv = mmap(0, sizeof(atfork_builtin), PROT_READ|PROT_WRITE, MAP_PRIVATE,
+ -1, 0);
Shouldn't that be MAP_ANON | MAP_PRIVATE ?
From: Greg Oster <oster@netbsd.org>
To: gnats-bugs@netbsd.org, lib-bug-people@netbsd.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org, oster@netbsd.org
Cc:
Subject: Re: lib/60925: named and cmake dump core in 10.2_STABLE amd64 after
pthread_atfork.c changes
Date: Sun, 25 Oct 2026 20:07:40 -0600
On 2026-10-25 17.45, Michael van Elst via gnats wrote:
> The following reply was made to PR lib/60925; it has been noted by GNATS.
>
> From: mlelstv@serpens.de (Michael van Elst)
> To: gnats-bugs@netbsd.org
> Cc:
> Subject: Re: lib/60925: named and cmake dump core in 10.2_STABLE amd64 after pthread_atfork.c changes
> Date: Sun, 25 Oct 2026 23:44:25 -0000 (UTC)
>
> gnats-admin@NetBSD.org ("oster@netbsd.org via gnats") writes:
>
> > Reverting this commit:
> >cvs rdiff -u -r1.17 -r1.17.2.1 src/lib/libc/gen/pthread_atfork.c
> >gets things working for me. But no idea as to the underlying issue.
>
>
> - return malloc(sizeof(atfork_builtin));
> + rv = mmap(0, sizeof(atfork_builtin), PROT_READ|PROT_WRITE, MAP_PRIVATE,
> + -1, 0);
>
>
> Shouldn't that be MAP_ANON | MAP_PRIVATE ?
I tested starting /usr/sbin/named with pthread_atfork.c build with
"MAP_ANON | MAP_PRIVATE" instead, and it worked fine!
Later...
Greg Oster
Responsible-Changed-From-To: lib-bug-people->martin
Responsible-Changed-By: riastradh@NetBSD.org
Responsible-Changed-When: Mon, 26 Oct 2026 03:32:50 +0000
Responsible-Changed-Why:
This arose from an incomplete pullup-10 #1380:
https://releng.netbsd.org/cgi-bin/req-10.cgi?show=1380
State-Changed-From-To: open->analyzed
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Mon, 26 Oct 2026 03:32:50 +0000
State-Changed-Why:
problem analyzed
>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.