NetBSD Problem Report #60633
From www@netbsd.org Sat Aug 22 22:23:04 2026
Return-Path: <www@netbsd.org>
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 "YR2" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 171F11A923C
for <gnats-bugs@gnats.NetBSD.org>; Sat, 22 Aug 2026 22:23:04 +0000 (UTC)
Message-Id: <20260822222302.7B3831A923E@mollari.NetBSD.org>
Date: Sat, 22 Aug 2026 22:23:02 +0000 (UTC)
From: ocb@disroot.org
Reply-To: ocb@disroot.org
To: gnats-bugs@NetBSD.org
Subject: cgdconfig missing pthread in ramdisk
X-Send-Pr-Version: www-1.0
X-From4GNATS: "ocb@disroot.org via gnats" <gnats-admin@NetBSD.org>
>Number: 60633
>Category: bin
>Synopsis: cgdconfig missing pthread in ramdisk
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Aug 22 22:25:01 +0000 2026
>Originator: ocb
>Release: NetBSD 11.0
>Organization:
>Environment:
NetBSD server 11.0 NetBSD 11.0 (GENERIC) #0: Sat Aug 22 20:55:27 UTC 2026 build@live:/tmp/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
cgdconfig calculates parameters based on the running hardware and sets the parallelism value to the number of available cpu threads. however, the cgdconfig binary for ramdisk-cgdroot is built without pthread, so verification is executed on a single thread. benchmarks show that opening the same cgd drive with identical parameters takes 20 seconds from an installed system, but 220 seconds from the ramdisk.
needs a better patch than the temporary fix provided which only works.
additionally, after patching it appears siginfo returns information on sh process rather than cgdconfig.
>How-To-Repeat:
compare the time it takes to open the same cgd device on boot from the ramdisk against opening it from the installed system.
>Fix:
--- src/sbin/cgdconfig/Makefile.orig
+++ src/sbin/cgdconfig/Makefile
@@ -23,7 +23,7 @@
.if ${MKARGON2} != "no"
SRCS+= argon2_utils.c
CPPFLAGS+= -DHAVE_ARGON2
-.if defined(CRUNCHEDPROG)
+.if defined(CRUNCHEDPROG) && !defined(CRUNCHEDPTHREAD)
ARGON2_NO_THREADS=1
.endif
.include "${NETBSDSRCDIR}/external/apache2/argon2/lib/libargon2/Makefile.inc"
--- src/distrib/common/list.cgdroot.orig
+++ src/distrib/common/list.cgdroot
@@ -5,6 +5,6 @@
PROG sbin/cgdconfig
PROG sbin/wsconsctl
-LIBS -lcrypto
+LIBS -lcrypto -lpthread
COPY ${NETBSDSRCDIR}/distrib/common/cgdroot.rc etc/rc
--- src/distrib/amd64/ramdisks/ramdisk-cgdroot/Makefile.orig
+++ src/distrib/amd64/ramdisks/ramdisk-cgdroot/Makefile
@@ -4,6 +4,7 @@
IMAGESIZE= 5000k
IMAGEDEPENDS=
CRUNCHENV= INIT_CHROOT=1
+CRUNCHENV+= CRUNCHEDPTHREAD=1
SMALLPROG_INET6=1
.include "${.CURDIR}/../common/Makefile.ramdisk"
(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.