[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: rpm-4.0.4: rpm -V md5sum failure, file corruption



On Mon, Jan 20, 2003 at 05:07:52PM -0600, matt-rpm@kindjal.net wrote:
> Greetings,
> 
> I have a filesystem corruption problem which may or may not be related
> to rpm.  Perhaps someone can help.
> 
> I have seen the same symptoms on kernel 2.2.20 and 2.2.23 (stock, from
> kernel.org) on both ext2 and ext3 filesystems, both with and without
> Andre Hedrick's IDE patches.
> 
> The symptoms are as follows:
> 
> case 1)
> 
> rpm -V <package> reports that a file fails an md5sum check:
> 
> bash# rpm -V adns
> ..5.....   /usr/lib/libadns.so.1.0
> 
> grab a copy of this file and run md5sum on it, to verify the broken-ness:
> 
> bash# cp /usr/lib/libadns.so.1.0 libadns.broken
> bash# md5sum libadns.broken /usr/lib/libadns.so.1.0
> f063a5fc902afee9e35e4a92289123ac  /usr/lib/libadns.so.1.0
> f063a5fc902afee9e35e4a92289123ac  libadns.broken
> bash# rpm -V adns
> bash#
> 
> So, first there's a problem, then there isn't.
> 
> case 2)
> 
> As above, but the copied file *actually* shows a different md5sum.
> 
> bash# rpm -V adns
> ..5.....   /usr/lib/libadns.so.1.0
> bash# cp /usr/lib/libadns.so.1.0 libadns.broken
> bash# md5sum libadns.broken /usr/lib/libadns.so.1.0
> f063a5fc902afee9e35e4a92289123ac  /usr/lib/libadns.so.1.0
> 28217c897d15b22181b903dca306d7fc  libadns.broken
> bash# rpm -V adns
> bash#
> 
> So it's broken, verified as broken, then okay.
> 
> Case 3)
> 
> Gets broken, stays broken:
> 
> bash# rpm -V adns
> ..5.....   /usr/lib/libadns.so.1.0
> bash# cp /usr/lib/libadns.so.1.0 libadns.broken
> bash# md5sum libadns.broken /usr/lib/libadns.so.1.0
> 28217c897d15b22181b903dca306d7fc  /usr/lib/libadns.so.1.0
> 28217c897d15b22181b903dca306d7fc  libadns.broken
> bash# rpm -V adns
> ..5.....   /usr/lib/libadns.so.1.0
> <Check md5sum on separate machine, and verify that it should be
> something else>
> bash#
> 

Think a bit.

You're getting strange results comparing two md5 sum checks. AFAICT,
either md5sum or rpm -V may be "lying".

One possible explanation is that different data is being returned
when reading. This wouldn't happen to be NFS, would it?

Another possible explanantion is memory/disk/cpu hardware problems.
Dunno IDE patches, but you might want to check on, say, a SCSI disk.

> In the case where the permanently corrupted file is a text file, say a
> configuration file, opening the file with vi shows NULL bytes where they
> shouldn't be.
> 
> So, I had thought that this was filesystem corruption independent of
> rpm, perhaps related to the ext3 filesystem (0.0.7a from kernel.org), or
> my media, but the symptoms appear on both ext2 and ext3, 2.2.20 and
> 2.2.23, on CompactFlash media and hard drives.
> 
> I wrote a script to run rpm -Va over and over, check for md5 failures,
> and copy files if failures are seen.  I get a failure once or twice a
> day, over several thousand iterations.  This happens on a large number
> of machines all with the same software.  I've used the fstest program
> from Samba(.org) to test the filesystem, and the filesystem appears to
> work fine under 2.2.23 and ext2 (for over 24 hours of testing).
> 

"Large number of machines": Hmmm, look for a common factor.

> Is it possible that rpm-4.0.4 is corrupting files, or at least
> incorrectly reporting md5sum failures?
> 
> Looking through strace shows rpm opening files read-only, but...

O_RDONLY means exactly what you think it does.

Be forewarned: There's an unexpected transformation of file content
with rpm -V if using prelinked libraries. Basically prelink -u is run,
and the md5 sum of the output of prelink "undo" is computed.
Transformation iff prelinked DSO, but /usr/lib/libadns.so.1.0 is a DSO.

> 
> Any ideas?

I'm betting a local SCSI disk is predictable.

73 de Jeff

-- 
Jeff Johnson	ARS N3NPQ
jbj@redhat.com (jbj@jbj.org)
Chapel Hill, NC





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []