NetBSD Problem Report #59364

From www@netbsd.org  Sat Apr 26 20:57:32 2025
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 "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 0CDC91A923C
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 26 Apr 2025 20:57:32 +0000 (UTC)
Message-Id: <20250426205730.C34161A923E@mollari.NetBSD.org>
Date: Sat, 26 Apr 2025 20:57:30 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: ctf tools needs update
X-Send-Pr-Version: www-1.0

>Number:         59364
>Category:       toolchain
>Synopsis:       ctf tools needs update
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 26 21:00:01 +0000 2025
>Last-Modified:  Fri Oct 09 15:10:02 +0000 2026
>Originator:     Taylor R Campbell
>Release:        current
>Organization:
The NetCTF Updation
>Environment:
>Description:
I tried using -Wl,-z,pack-relative-relocs (see PR bin/59360: ld.elf_so(8): missing RELR support, https://gnats.NetBSD.org/59360) and nbctfmerge failed with:

ERROR: nbctfmerge: h_r_relative_pack: Cannot get sect .relr.dyn data: Invalid section descriptor

ctf upstream probably also supports >32k types these days (not verified) which will help us avoid hitting limits in the kernel that break dtrace type information too.
>How-To-Repeat:
enable newfangled linker toys like -Wl,-z,pack-relative-relocs in a MKCTF=yes build
>Fix:
Yes, please!

>Audit-Trail:
From: matthew green <mrg@eterna23.net>
To: gnats-bugs@netbsd.org
Cc: toolchain-manager@netbsd.org, gnats-admin@netbsd.org,
    netbsd-bugs@netbsd.org
Subject: re: toolchain/59364: ctf tools needs update
Date: Mon, 28 Apr 2025 07:15:04 +1000

 yes please.

 also see PR#57664: ctf tools don't handle DWARF version 5.

 our in-tree GCC has a patch to default to version 4.


 .mrg.

From: Christos Zoulas <christos@zoulas.com>
To: matthew green <mrg@eterna23.net>
Cc: gnats-bugs@netbsd.org,
 toolchain-manager@netbsd.org,
 gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: toolchain/59364: ctf tools needs update
Date: Wed, 4 Jun 2025 15:34:15 -0400

 --Apple-Mail=_D1F413C5-5867-48E0-BCE6-D10041F36561
 Content-Transfer-Encoding: quoted-printable
 Content-Type: text/plain;
 	charset=us-ascii


 This is not a problem with CTF. It just calls elf_getdata() from =
 elftoolchain and libelf does
 not support reading the .relr.dyn section. I suspect the same issue with =
 DWARF 4 vs 5.
 libdwarf in elftoolchain needs updating....

 christos=

 --Apple-Mail=_D1F413C5-5867-48E0-BCE6-D10041F36561
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename=signature.asc
 Content-Type: application/pgp-signature;
 	name=signature.asc
 Content-Description: Message signed with OpenPGP

 -----BEGIN PGP SIGNATURE-----
 Comment: GPGTools - http://gpgtools.org

 iF0EARECAB0WIQS+BJlbqPkO0MDBdsRxESqxbLM7OgUCaECftwAKCRBxESqxbLM7
 Ohc+AKCpfESctW1Qb8yhSvJDe+3cfbpTtQCgu1i04OkzgYJFxJBQoIK9qehB10M=
 =5woL
 -----END PGP SIGNATURE-----

 --Apple-Mail=_D1F413C5-5867-48E0-BCE6-D10041F36561--

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/59364 CVS commit: src/tests
Date: Wed, 17 Dec 2025 23:43:52 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Wed Dec 17 23:43:52 UTC 2025

 Modified Files:
 	src/tests/lib/csu: Makefile
 	src/tests/libexec/ld.elf_so: Makefile

 Log Message:
 tests/lib/csu, tests/libexec/ld.elf_so: Apply CTFMERGE=: workaround.

 The workaround for

 PR toolchain/59364: ctf tools needs update

 required an update after fixing

 PR toolchain/57241: mips64el--netbsd-install core dumps randomly

 by splitting the recipes for ${PROG} and ${PROG}.debug into an
 intermediate ${PROG}.link to avoid overwriting ${PROG} inside the
 recipe for ${PROG}.debug.

 This is kludgey (writing the `.link' suffix into a Makefile isn't
 great) but I see only two cases of it so this'll do for now.


 To generate a diff of this commit:
 cvs rdiff -u -r1.13 -r1.14 src/tests/lib/csu/Makefile
 cvs rdiff -u -r1.32 -r1.33 src/tests/libexec/ld.elf_so/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/59364 CVS commit: [netbsd-11] src
Date: Fri, 9 Oct 2026 15:09:02 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Fri Oct  9 15:09:02 UTC 2026

 Modified Files:
 	src/libexec/ld.elf_so [netbsd-11]: Makefile
 	src/share/mk [netbsd-11]: bsd.kmodule.mk bsd.lib.mk bsd.prog.mk
 	src/tests/lib/csu [netbsd-11]: Makefile
 	src/tests/libexec/ld.elf_so [netbsd-11]: Makefile

 Log Message:
 Pull up following revision(s) (requested by riastradh in ticket #514):

 	share/mk/bsd.prog.mk: revision 1.360
 	share/mk/bsd.lib.mk: revision 1.424
 	share/mk/bsd.prog.mk: revision 1.361
 	tests/libexec/ld.elf_so/Makefile: revision 1.33
 	tests/lib/csu/Makefile: revision 1.14
 	share/mk/bsd.kmodule.mk: revision 1.87
 	share/mk/bsd.kmodule.mk: revision 1.88
 	libexec/ld.elf_so/Makefile: revision 1.152

 bsd.prog.mk: Fix parallel builds of debug data.

 Previously, we had one rule to generate foo, and another rule to
 derive foo.debug from it with objcopy -- and then rewrite foo _in
 place_ to strip the debug data with objcopy.

 This is wrong -- one rule should never overwrite another rule's
 target; this violates the contract with make(1), and can lead it to
 run rules in parallel on files that are changing, which in turn can
 lead the rules to behave mysteriously or crash.

 It's still not clear why in our autobuilds, the only cases where we
 saw these crashes were in mips64 builds of programs that use
 compat/exec.mk (mainly external/bsd/ipf/bin/ipftest, but also
 usr.sbin/crash and usr.bin/systat).  But the bug this change fixes is
 well-understood, and now someone has observed it in a non-mips build,
 so I'm throwing in the towel on figuring out what makes these
 particular programs more likely to trigger the problem.

 PR toolchain/57241: mips64el--netbsd-install core dumps randomly

 bsd.kmodule.mk: Fix parallelism in debug data generation recipes.

 In the recipe for foo.kmod.debug, don't overwrite foo.kmod in place.

 Instead, generate foo.kmod.link with debug data included, and then
 derive foo.kmod (no debug data) and foo.kmod.debug (only debug data)
 from it in separate recipes.

 Same issue as we had with bsd.lib.mk and bsd.prog.mk in the past.

 PR toolchain/57241: mips64el--netbsd-install core dumps randomly
 tests/lib/csu, tests/libexec/ld.elf_so: Apply CTFMERGE=: workaround.

 The workaround for
 PR toolchain/59364: ctf tools needs update
 required an update after fixing
 PR toolchain/57241: mips64el--netbsd-install core dumps randomly
 by splitting the recipes for ${PROG} and ${PROG}.debug into an
 intermediate ${PROG}.link to avoid overwriting ${PROG} inside the
 recipe for ${PROG}.debug.

 This is kludgey (writing the `.link' suffix into a Makefile isn't
 great) but I see only two cases of it so this'll do for now.
 bsd.*.mk: Use objcopy without -p to strip debug data.

 No need to preserve the date with -p/--preserve-dates -- the only
 meaningful effect it has is to cause make(1) to rerun it every time,
 because make(1) treats exactly the same date as out-of-date.

 Followup after:
 PR toolchain/57241: mips64el--netbsd-install core dumps randomly


 To generate a diff of this commit:
 cvs rdiff -u -r1.151.2.2 -r1.151.2.3 src/libexec/ld.elf_so/Makefile
 cvs rdiff -u -r1.86 -r1.86.4.1 src/share/mk/bsd.kmodule.mk
 cvs rdiff -u -r1.419.2.2 -r1.419.2.3 src/share/mk/bsd.lib.mk
 cvs rdiff -u -r1.356.2.2 -r1.356.2.3 src/share/mk/bsd.prog.mk
 cvs rdiff -u -r1.12 -r1.12.2.1 src/tests/lib/csu/Makefile
 cvs rdiff -u -r1.28.2.4 -r1.28.2.5 src/tests/libexec/ld.elf_so/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

NetBSD Home
NetBSD PR Database Search

(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.