🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: muc.lists.freebsd.bugs
Article #396

[Bug 300651] md5sum occasionally generates malformed checksum manifest records

#396
From: bugzilla-noreply
Date: Tue, 10 Nov 2026 12:42
98 lines
5073 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300651

            Bug ID: 300651
           Summary: md5sum occasionally generates malformed checksum
                    manifest records
           Product: Base System
           Version: 15.1-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: bkline@rksystems.com

DESCRIPTION
===========

While generating MD5 checksum manifests for large directory trees, FreeBSD's
`/sbin/md5sum` occasionally produces malformed output records.

The manifests were generated using:

  find . -type f -exec md5sum {} + > ~/etc/da0.md5


Three separate manifests were generated in this manner, covering a total of
33,348,276 files.

Inspection revealed 15 malformed records across the three manifests. These
malformed lines have the following pattern:

<CHECKSUM>  <POSSIBLY-TRUNCATED PATH><CHECKSUM>  <PATH><NEWLINE>

In other words, records for two different files are concatenated on the same
line, dropping at least the separating newline, and usually truncating a
portion of the path for the first of the two files.

The following command identified the malformed records:

egrep -c '  \./.*  \./' da[025]-freebsd.md5
da0-freebsd.md5:6
da2-freebsd.md5:1
da5-freebsd.md5:8

As expected, each of these malformed records resulted in a "FAILED open or
read" error.

Here's a sample malformed record:
e2819802df52922ab64f514b10798db7 
./old-backups/ws-20170311/home/bklf16ea05c772f4e5c8a36f02980a3daa7 
./old-backups/ws-20170311/home/bkline/Downloads/android-studio/lib/ant/README

I can attach the complete set of malformed records, if desired, though they all
follow this same pattern.

ENVIRONMENT
===========

Hardware: Lenovo ThinkServer TS140 (amd64), 32GB RAM, 2TB Crucial BX500 SSD
OS:       FreeBSD 15.1-RELEASE-p6 releng/15.1-n283643-95719d8a895b
Storage:  ZFS compression=zstd
Version:  md5sum (FreeBSD) 15.1

REPRO
=====

Unfortunately, I am unable to provide a short set of instructions for
reproducing the problem, as the percentage of records that were malformed in
these manifests was only 0.000045% (15 failures in 33,348,261 records).

WORKAROUND
==========

Using the GNU implementation (md5sum (GNU coreutils) 9.9, installed as gmd5sum)
I was able to generate well-formed manifest records for all the files and
successfully verify the checksums of the copied files. I will note that this
program was markedly faster (though I don't have useful timings for comparison,
because the FreeBSD implementation's process died several times with a "Broken
pipe" error message during the "md5sum -c" phase; I can report that as a
separate bug if you want, though repro steps would be at least as challenging
as for this bug).

-- 
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID: <bug-300651-227@https.bugs.freebsd.org/bugzilla/>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mail
From: bugzilla-noreply@freebsd.org
Newsgroups: muc.lists.freebsd.bugs
Subject: [Bug 300651] md5sum occasionally generates malformed checksum
 manifest records
Date: Tue, 10 Nov 2026 12:42:02 +0000
Organization: Newsgate at muc.de e.V.
Approved: news-admin@muc.de
Distribution: world
Message-ID: <bug-300651-227@https.bugs.freebsd.org/bugzilla/>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
	logging-data="88415"; mail-complaints-to="news-admin@muc.de"
X-Original-To: bugs@mlmmj.nyi.freebsd.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1794314522;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding;
	bh=eQnagqlpe3hxwI+qWqU3GbyxpyAN6UEnzBSK+6igTpc=;
	b=TCEwBkIsmlln4haAu2q05RTGdA/yZlilkJ+eO8K7T33/RGHxx6amNJz3VaLJ74i69DfA1k
	zQr/GS/zbHHQxkLd6tNoCwAstiK0+PSBuEnMgax3FiLX6n4MVfBfH+nhC798PNIO+EupIQ
	vmdm1pijp0bTaK5o+6cTX3jUjA5EywAH71NHHvSAx7/XzumCKdrGshvEPjMgXr1SMb3xFi
	luPmyIVgJ/baohfyH5Lnru0Cx5pgpJRI4oIjf2/JaPZFfshNtkfEn976gGAdBDBXTlyX37
	J1bjp30cYpVg0U8kd2I4MgBrndEUQNU1M/ilIncjZhRI8aI5voDV4jI3qXOghQ==
X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f
Auto-Submitted: auto-generated
Precedence: list
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes