Bug 1745020

Summary: rpm: rpm-build produced corrupt libxml2-static package on aarch64
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: igor.raits, jbastian, mjw, packaging-team-maint, pmatilai, pmoravco, vmukhame, yaneti
Target Milestone: ---   
Target Release: ---   
Hardware: aarch64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-08 12:51:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
libxml2-static-2.9.9-4.fc32.aarch64.rpm none

Description Florian Weimer 2019-08-23 13:43:17 UTC
Created attachment 1607315 [details]
libxml2-static-2.9.9-4.fc32.aarch64.rpm

https://kojipkgs.fedoraproject.org//packages/libxml2/2.9.9/4.fc32/aarch64/libxml2-static-2.9.9-4.fc32.aarch64.rpm (also attached) has a file digest in the header which does not match the payload:

$ rpm -qp --qf '[%{FILENAMES} %{FILESIZES} %{FILEDIGESTS}\n]' libxml2-static-2.9.9-4.fc32.aarch64.rpm 
/usr/lib64/libxml2.a 3430578 9dff7212627fe612f659c2ad74eca98f978312242827c59cf21c5ce31e952ddc
/usr/share/licenses/libxml2-static 0 
/usr/share/licenses/libxml2-static/Copyright 1289 c5c63674f8a83c4d2e385d96d1c670a03cb871ba2927755467017317878574bd
$ rpm2cpio libxml2-static-2.9.9-4.fc32.aarch64.rpm | cpio -id
6704 blocks
$ ls -l usr/lib64/libxml2.a 
-rw-r--r--. 1 fweimer fweimer 3430578 Aug 23 15:39 usr/lib64/libxml2.a
$ sha256sum usr/lib64/libxml2.a
9820dabb796ae62e4a1e9952914a5af622529c108dbfe138fe3dd498732ddd70  usr/lib64/libxml2.a

(I don't have access to a real aarch64 system which can create a Fedora rawhide chroot to verify this, unfortunately.)

This is not expected to happen, ever.

The builder was buildhw-aarch64-07.arm.fedoraproject.org: https://koji.fedoraproject.org/koji/taskinfo?taskID=37080236

Comment 1 Florian Weimer 2019-08-23 14:27:21 UTC
The corruption does not seem to reproduce, so I submitted libxml2-2.9.9-5.fc32 to fix it.

Comment 2 Panu Matilainen 2019-08-26 07:15:02 UTC
Yup. As to what caused it, I guess we'll just have to wait and see if a pattern emerges. It could be a bug in zstd or rpm, or it could be something else running on the system at that time (there's a window between calculating the hash and actually packing the file into the payload, and for example prelink running on a builder could cause such issues).

Just out of curiosity, how did you notice it?

FWIW, you can kind of install non-native packages with enough disabler switches:

[root@sopuli Downloads]# rm -rf /srv/test/; rpm -Uvh --ignorearch --nodeps --noscripts --root /srv/test/ ~pmatilai/Downloads/libxml2-static-2.9.9-4.fc32.aarch64.rpm 
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:libxml2-static-2.9.9-4.fc32      ################################# [100%]
error: unpacking of archive failed on file /usr/lib64/libxml2.a;5d6385f5: cpio: Digest mismatch
error: libxml2-static-2.9.9-4.fc32.aarch64: install failed

Comment 3 Florian Weimer 2019-08-26 08:35:05 UTC
(In reply to Panu Matilainen from comment #2)
> Just out of curiosity, how did you notice it?

I regularly unpack all Fedora packages (at least the buildroot), to extract ELF symbol information and other data.

Comment 4 Panu Matilainen 2019-08-26 10:04:51 UTC
FWIW, just ran a test-install of all (non-conflicting) packages on Fedora-Server-dvd-aarch64-Rawhide-20190825 image, no corrupt files found. So it appears to be a rare, non-reproducable issue, the worst kind :-/

Comment 5 Jeff Bastian 2019-08-26 20:39:10 UTC
I ran a 50x loop of rebuilding libxml2 and comparing sha256sums and I was unable to reproduce this error, so it does indeed seem rare.  This was on Fedora 30 GOLD (kernel 5.0.9-301.fc30.aarch64) on an AppliedMicro Mustang system (X-Gene aarch64 CPU).

Comment 6 Panu Matilainen 2019-10-08 12:51:58 UTC
As no further incidents have been found, I think we can close this. Do reopen if it should recur, but right now there's just nothing to go on with.