NetBSD Problem Report #58226

From martin@duskware.de  Mon May  6 14:38:55 2024
Return-Path: <martin@duskware.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))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 5CA631A9238
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  6 May 2024 14:38:55 +0000 (UTC)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: errors in set tests
X-Send-Pr-Version: 3.95

>Number:         58226
>Category:       toolchain
>Synopsis:       errors in set tests
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 06 14:40:00 +0000 2024
>Last-Modified:  Wed May 15 13:35:01 +0000 2024
>Originator:     Martin Husemann
>Release:        NetBSD 10.99.10
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD space-truckin.duskware.de 10.99.10 NetBSD 10.99.10 (GENERIC) #346: Mon May 6 11:01:29 CEST 2024 martin@seven-days-to-the-wolves.aprisoft.de:/work/src/sys/arch/evbarm/compile/GENERIC evbarm
Architecture: earmv7hfeb
Machine: evbarm
>Description:

Somehow I sometimes get inconsistent mtree data generated for the sets build
by update build.sh -u runs.

Example failure from the sets tests:

tc-so:Executing command [ mtree -e ]
tc-se:Fail: incorrect exit status: 2, expected: 0
tc-se:stdout:
tc-se:rescue/[: 
tc-se:  size (8412280, 8412304)
tc-se:  sha256 (0xc397eb3e182ba4df2af5b09f7c1004fd5f09f93b89fed819451d84e69f907af9, 0xee14402ac2a37e0f270b7d16feef0671f66451a8cd3541a267f269d5868ec257)

but the build machines $DESTDIR/rescue/[ and the installed version
agree:

> ll \[
-r-xr-xr-x  154 builds  builds  8412304 May  6 09:30 [*
> cksum -a sha256 \[
SHA256 ([) = ee14402ac2a37e0f270b7d16feef0671f66451a8cd3541a267f269d5868ec257

and I don't see where the bogus size/checksum recorded in the mtree file
come from.

>How-To-Repeat:
build sets with -u, install, run usr.bin/mtree/t_sets.

Full build.sh command line used in this case:

./build.sh -u -U -m evbearmv7hf-eb -M /work/obj/evbearmv7hf-eb -R /branches/rel-current/evbearmv7hf-eb -V BUILDINFO=Build locally, cvs.netbsd.org source tree date: 2024-05-06 06:16 UTC -V MKDEBUG=yes -V TMPDIR=/var/shm/btmp -V MKCROSSGDB=yes -T /work/tools -D /branches/hosts-current/evbearmv7hf-eb -j 8 -x -X /work/xsrc distribution sets


>Fix:
n/a

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: toolchain/58226: building crunched binaries is not MAKE_JOBS save
Date: Wed, 15 May 2024 14:18:44 +0200

 mrg identified the culprit in the crunchgen generated .mk fragment,
 e.g. $OBJ/rescue/rescue.mk:

 all: ${PROG}.crunched
 ${PROG}.crunched: ${SUBMAKE_TARGETS} .WAIT ${PROG}.strip
 ${PROG}.strip:
         ${MAKE} -f ${PROG}.mk ${PROG}
         @[ -f ${PROG}.unstripped -a ! ${PROG} -nt ${PROG}.unstripped ] || { \
                 ${_MKSHMSG:Uecho} "  strip and clear PaX flags " ${PROG}; \
                 cp ${PROG} ${PROG}.unstripped && \
                 ${OBJCOPY} -S ${OBJCOPY_REMOVE_FLAGS} ${PROG} && \
                 ${PAXCTL} -0 ${PROG} && \
                 touch ${PROG}.unstripped; \
         }


 This creates ${PROG}.unstripped and modifies it in-place, racing with other
 make instances getting at this job.

 Martin

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: toolchain/58226: building crunched binaries is not MAKE_JOBS save
Date: Wed, 15 May 2024 15:33:19 +0200

 ... but on closer observation I also see broken sha values on other
 links in non-crunched parts of the tree:

 [/tmp] h-pulse # ls -lisa /bin/[ /bin/test 
 651458 72 -r-xr-xr-x  2 root  wheel  73600 May 15 08:41 /bin/[*
 651458 72 -r-xr-xr-x  2 root  wheel  73600 May 15 08:41 /bin/test*
 [/tmp] h-pulse # egrep 'bin/\\133|bin/test' /etc/mtree/set.base
 ./bin/\133 type=file uname=root gname=wheel mode=0555 size=73600 sha256=ce23e5de0cf34f18c332708ec5bbd8380b5448e5b94eaa4a609ba3a17dac75ae
 ./bin/test type=file uname=root gname=wheel mode=0555 size=73600 sha256=2499d6f817197cbc0f5557c48e376023582ba54a3316dc3544a9eb5b91bf7b57
 [/tmp] h-pulse # cksum -a sha256 /bin/[ /bin/test 
 SHA256 (/bin/[) = 2499d6f817197cbc0f5557c48e376023582ba54a3316dc3544a9eb5b91bf7b57
 SHA256 (/bin/test) = 2499d6f817197cbc0f5557c48e376023582ba54a3316dc3544a9eb5b91bf7b57


 so the crunchgen issue may be totally related (and would probably not hit
 as persistently this one does).

 Martin

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.