NetBSD Problem Report #60258
From www@netbsd.org Wed May 13 11:41:16 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)
client-signature RSA-PSS (2048 bits))
(Client CN "mail.netbsd.org", Issuer "R13" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 714D51A9239
for <gnats-bugs@gnats.NetBSD.org>; Wed, 13 May 2026 11:41:16 +0000 (UTC)
Message-Id: <20260513114115.593CA1A923A@mollari.NetBSD.org>
Date: Wed, 13 May 2026 11:41:15 +0000 (UTC)
From: keiji@hiemalis.org
Reply-To: keiji@hiemalis.org
To: gnats-bugs@NetBSD.org
Subject: textproc/hyperestraier: Segfaults inside libqdbm remedied by adding -O1 -fno-strict-aliasing
X-Send-Pr-Version: www-1.0
X-From4GNATS: "keiji@hiemalis.org via gnats" <gnats-admin@NetBSD.org>
>Number: 60258
>Category: pkg
>Synopsis: textproc/hyperestraier: Segfaults inside libqdbm remedied by adding -O1 -fno-strict-aliasing
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Wed May 13 11:45:00 +0000 2026
>Originator: Wada Keiji
>Release: 10.1
>Organization:
>Environment:
NetBSD poker 10.1 NetBSD 10.1 (GENERIC) #0: Mon Dec 16 13:08:11 UTC 2024 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
When running textproc/hyperestraier compiled with standard pkgsrc optimization flags (-O2), the application immediately terminates with a segmentation fault (SEGV) inside libqdbm.so.14 (from databases/qdbm).
This issue is highly indicative of strict aliasing violations inside either the qdbm database logic or hyperestraier's direct interaction with the library, causing the compiler to emit unsafe optimizations at higher optimization tiers (-O2).
Lowering the optimization level to "-O1" and explicitly forcing "-fno-strict-aliasing" entirely prevents the memory corruption, restoring full stability to hyperestraier.
>How-To-Repeat:
1. Build both databases/qdbm and textproc/hyperestraier on NetBSD using default pkgsrc flags.
2. Execute hyperestraier (e.g., performing a document search or index update).
3. Observe an immediate segmentation fault (SEGV) pointing to libqdbm.so.14.
>Fix:
The issue can be mitigated cleanly by injecting safer compiler flags to both packages. Appending the following logic to /etc/mk.conf successfully fixes the runtime crashes:
.if ${PKGPATH} == "databases/qdbm" || ${PKGPATH} == "textproc/hyperestraier"
CFLAGS+= -O1 -fno-strict-aliasing
.endif
It is suggested that the pkgsrc maintainers add corresponding flags (e.g., using CFLAGS+= -fno-strict-aliasing or adjusting optimization limits) directly to the respective Makefiles in databases/qdbm and textproc/hyperestraier.
(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.