#575267 cpio: Checksum-errors in copy-in mode on AMD64

Package:
cpio
Source:
cpio
Description:
GNU cpio -- a program to manage archives of files
Submitter:
Axel Freyn
Date:
2025-08-11 18:29:01 UTC
Severity:
important
Tags:
#575267#5
Date:
2010-03-24 16:18:21 UTC
From:
To:
When extracting files from a cpio-archive of type "crc", cpio complains about
checksum errors for some files, however the files are extracted correctly.
This happens also when using cpio version 2.11-1 to extract files from archives
created with an older cpio-version (2.10-1) (With cpio 2.10-1, the old archive
could be extraced without CRC-errors; that's why I assume the problem to be in
copy-in mode).

The errors also appears when only verifying the checksum with "cpio -i
--only-verify-crc".

An example-file triggering the bug is the GoOo-release-file for Win32:
go-oo.mirrorbrain.org/stable/win32/3.2/GoOo-3.2-13.exe

The bug can be triggered e.g by

aff@zeus:~# echo GoOo-3.2-13.exe | cpio -o -H crc > test.cpio
383402 blocks
abf@zeus:~# cpio -i --only-verify-crc < test.cpio
cpio: GoOo-3.2-13.exe: checksum error (0x5d90c3303, should be 0xd90c3303)
383402 blocks


However, the file is correctly stored in the archive and can be extracted correctly:

abf@zeus:~# md5sum GoOo-3.2-13.exe
238c3a70223cb33036617fed3c7440c9  GoOo-3.2-13.exe
abf@zeus:~$ rm GoOo-3.2-13.exe
abf@zeus:~$ cpio -i < test.cpio
cpio: GoOo-3.2-13.exe: checksum error (0x5d90c3303, should be 0xd90c3303)
383402 blocks
abf@zeus:~$ md5sum GoOo-3.2-13.exe
238c3a70223cb33036617fed3c7440c9  GoOo-3.2-13.exe

I tried also a 32bit system (squeeze;  Linux 2.6.32-3-686; cpio 2.11-1; libc6
2.10.2-6; dpkg 1.15.5.6). There, cpio works correctly with this file (but maybe
a similar problem appears for other files?).

#575267#10
Date:
2013-05-22 12:32:48 UTC
From:
To:
Hello,

CPIO is still not fixed in Debian (tested on sid). Checksum errors still
occurs on cpio archives, amd64.

Upstream patch (applied on git but never released, as cpio 2.11 is
pretty old) can be found there :
http://git.gnu.org.ua/gitweb?p=cpio.git;a=commitdiff;h=refs/heads/master

Demo, first on a debian sid host, then in a chroot containing cpio with
patch applied :

debian-ltop:/share/src/0linux/paquets/x86_64/base# cpio -i
--only-verify-crc < gcc-4.7.3-x86_64-4.spack
cpio: files.xz: erreur sur la somme de contrôle (0x17026091c, devrait
être 0x7026091c).
94683 blocs
debian-ltop:/share/src/0linux/paquets/x86_64/base# cd /0linux/
debian-ltop:/0linux# chroot ./
debian-ltop:/# cd share/src/0linux/paquets/x86_64/base/
debian-ltop:/share/src/0linux/paquets/x86_64/base# cpio -i
--only-verify-crc < gcc-4.7.3-x86_64-4.spack
94683 blocs

*.spack are just cpio archives (package format for a homemade distro).
The checksum error appears on relatively big archives. You may test
those archives here (the biggest ones, like 'gcc' or 'linux') :
http://ftp.igh.cnrs.fr/pub/os/linux/0linux/paquets/x86_64/base/

This bug is a blocker when cpio calls are embedded into scripts.

Thanks,


appzer0

#575267#15
Date:
2019-08-19 10:45:13 UTC
From:
To:
control: tags -1 patch
control: fixed -1 2.12+dfsg-1
control: forwarded -1 http://git.savannah.gnu.org/cgit/cpio.git/commit/?id=ccec71ec318fdf739f55858d5bffaf4fd6520036

could this be fixed for Stretch, please?

Sebastian

#575267#26
Date:
2025-08-11 18:27:03 UTC
From:
To:
This was fixed by upstream in version 2.12.