Thread View: muc.lists.freebsd.bugs
8 messages
8 total messages
Started by bugzilla-noreply
Tue, 10 Nov 2026 12:42
[Bug 300651] md5sum occasionally generates malformed checksum manifest records
Author: bugzilla-noreply
Date: Tue, 10 Nov 2026 12:42
Date: Tue, 10 Nov 2026 12:42
98 lines
5073 bytes
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
[Bug 300651] md5sum occasionally generates malformed checksum manifest records
Author: bugzilla-noreply
Date: Tue, 10 Nov 2026 17:05
Date: Tue, 10 Nov 2026 17:05
13 lines
2448 bytes
2448 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300651 --- Comment #1 from Dag-Erling Smørgrav <des@FreeBSD.org> --- *** Bug 300652 has been marked as a duplicate of 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
[Bug 300651] md5sum occasionally generates malformed checksum manifest records
Author: bugzilla-noreply
Date: Tue, 10 Nov 2026 17:27
Date: Tue, 10 Nov 2026 17:27
15 lines
2511 bytes
2511 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300651 --- Comment #2 from Bob Kline <bkline@rksystems.com> --- I wasn't sure how to deal with the field asking how many people are affected by this bug. That's a level of cosmic awareness I haven't yet achieved. :-} -- 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
[Bug 300651] md5sum occasionally generates malformed checksum manifest records
Author: bugzilla-noreply
Date: Tue, 10 Nov 2026 20:47
Date: Tue, 10 Nov 2026 20:47
17 lines
2572 bytes
2572 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300651 --- Comment #3 from Mark Linimon <linimon@FreeBSD.org> --- (In reply to Bob Kline from comment #2) IMHO this field is useless. Since we have no one paid to do triage, there is no one to look at it. I think it should go away on our next update to Bugzilla. -- 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
[Bug 300651] md5sum occasionally generates malformed checksum manifest records
Author: bugzilla-noreply
Date: Tue, 10 Nov 2026 22:56
Date: Tue, 10 Nov 2026 22:56
73 lines
4989 bytes
4989 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300651
Bob Kline <bkline@rksystems.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #277170|text/x-python-script |text/plain
mime type| |
--- Comment #4 from Bob Kline <bkline@rksystems.com> ---
Created attachment 277170
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=277170&action=edit
Script to generate repro test files
My own use case involved a bit over 17TB of data, which I thought might be a
daunting barrier for anyone trying to reproduce the reported behavior. However,
it occurred to me that it might not be necessary to use large files for the
repro case, and in fact, having the program generate and write the checksums
faster (because the files were smaller) might even increase the likelihood of
failure. After all, the problem is in the output, not in the generation of the
checksums.
So I created a Python script to generate lots of small files, used it to create
10,000,000 files, and fired up md5sum. However, that didn't result in any
corrupted manifest records. Thinking about the differences between my use case
and the repro test case (other than the file sizes), I realized that all of the
paths for the files (a) were short, and (b) had the same length (18
characters). So I tweaked the script, lengthening the directory names (29
characters each), increased the depth (reducing the number of files in each
leaf directory from 1,000 to 10) and varying the length of the files names
randomly (minimum length 8 and maximum length 100). I ran the job again with
the new set of files, and this time there were 21 corrupted records in the
manifest.
I don't know whether it's related, but I also noticed that there were a bunch
of "Invalid argument" errors. I'll attach those error messages separately. I
have no idea what that message might be referring to. The paths included with
the messages certainly look like valid paths to me, and are roughly an order of
magnitude shorter that PATH_MAX, so 🤷♂️.
The repro instructions are at the top of the Python script, but I'll include
them here as well.
- ./make-md5-repro-files.py /some/path
- cd /some/path
- find . -type f -exec md5sum {} + > /tmp/200651-repro.md5
- egrep -c ' \./.* \./' /tmp/200651-repro.md5
Be sure /some/path is on a file system with at least enough free space to
hold ~30G of files. The directory must be empty.
The output of the last command will be the count of malformed manifest records
created by md5sum.
--
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
[Bug 300651] md5sum occasionally generates malformed checksum manifest records
Author: bugzilla-noreply
Date: Tue, 10 Nov 2026 22:59
Date: Tue, 10 Nov 2026 22:59
19 lines
2600 bytes
2600 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300651 --- Comment #5 from Bob Kline <bkline@rksystems.com> --- Created attachment 277172 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=277172&action=edit "Invalid argument" error messages As promised, here are the "Invalid argument" error messages emitted by md5sum. -- 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
[Bug 300651] md5sum occasionally generates malformed checksum manifest records
Author: bugzilla-noreply
Date: Wed, 11 Nov 2026 15:08
Date: Wed, 11 Nov 2026 15:08
15 lines
2488 bytes
2488 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300651 --- Comment #6 from Bob Kline <bkline@rksystems.com> --- Doesn't look like the comments on these tickets are editable, so ... s/shorter that PATH_MAX/shorter than PATH_MAX/ -- 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
[Bug 300651] md5sum occasionally generates malformed checksum manifest records
Author: bugzilla-noreply
Date: Thu, 12 Nov 2026 20:48
Date: Thu, 12 Nov 2026 20:48
65 lines
4912 bytes
4912 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=300651 --- Comment #7 from Bob Kline <bkline@rksystems.com> --- I decided to see if the approach of testing with lots of small files might work for reproducing the other problem I mentioned (the check phase dies with an error message before completion in the middle of processing a large manifest). 14:35:07 /tmp/repro $ md5sum -c --quiet /tmp/repro2.md5 md5sum: ./directory-level-00-branch-019/directory-level-01-branch-098/directory-level-02-branch-069/file-0001998694-rgsihyu3g1zkohms0bu2w6qd5eyot7gfv79k7jr66feuv878787ssrb8qy02s7l0l9kn6: Invalid argument 15:03:32 /tmp/repro $ grep -n './directory-level-00-branch-019/directory-level-01-branch-098/directory-level-02-branch-069/file-0001998694-rgsihyu3g1zkohms0bu2w6qd5eyot7gfv79k7jr66feuv878787ssrb8qy02s7l0l9kn6' /tmp/repro2.md5 1291:e0c5526d7010da6878d778571fb7bcaa ./directory-level-00-branch-019/directory-level-01-branch-098/directory-level-02-branch-069/file-0001998694-rgsihyu3g1zkohms0bu2w6qd5eyot7gfv79k7jr66feuv878787ssrb8qy02s7l0l9kn6 15:08:39 /tmp/repro $ md5sum -c /tmp/repro2.md5 > /tmp/repro-check.log md5sum: ./directory-level-00-branch-019/directory-level-01-branch-049/directory-level-02-branch-086/file-0001949864-qpp2ruk30zn6kaaphn434pxh4jtun8042tfwd8bkhv6v61kfrmngntexm7u54k0hvmzqqkq71mqgf0kxb3nj5f0tlgoucg91: Invalid argument 15:29:47 /tmp/repro $ grep -n './directory-level-00-branch-019/directory-level-01-branch-049/directory-level-02-branch-086/file-0001949864-qpp2ruk30zn6kaaphn434pxh4jtun8042tfwd8bkhv6v61kfrmngntexm7u54k0hvmzqqkq71mqgf0kxb3nj5f0tlgoucg91' /tmp/repro2.md5 19093:0a0363e6bbfd92ac0322c7e02a9df523 ./directory-level-00-branch-019/directory-level-01-branch-049/directory-level-02-branch-086/file-0001949864-qpp2ruk30zn6kaaphn434pxh4jtun8042tfwd8bkhv6v61kfrmngntexm7u54k0hvmzqqkq71mqgf0kxb3nj5f0tlgoucg91 15:31:15 /tmp/repro $ wc -l /tmp/repro-check.log 18830 /tmp/repro-check.log So yes, it _is_ possible to reproduce this behavior as well, without dedicating time and storage space to test with terabytes of data. Again, I don't know whether this is an unrelated problem warranting a separate bug report, or if it's all tied in together, all caused by the same flaw in the program. My guess would be unrelated (after all, the crash happens during the check phase, and the bug reported by this ticket happens during the checksum-generation phase), but I'll leave that decision to those more familiar with the inner workings of the code. Again, none of these anomalies show up when using the GNU version of md5sum. -- 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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads