[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 Thu, Jan 23, 2003 at 01:24:42PM -0600, Matthew Callaway wrote:
> An update on this problem...
> 
> I patched rpm-4.0.4 to print out the md5sums it's using in its
> comparisons, the one from the rpm database and the one it calculates
> from the file on disk.  In my "failure" case, where the md5sum fails
> temporarily, the md5sum that's wrong is the one in the rpmdb, not the
> one calculated from the file on disk.
> 
> Here's the patch I'm using:
> diff -urbB rpm-4.0.4.orig/lib/verify.c rpm-4.0.4/lib/verify.c
> --- rpm-4.0.4.orig/lib/verify.c Mon Jan 21 09:18:27 2002
> +++ rpm-4.0.4/lib/verify.c      Wed Jan 22 10:28:28 2003
> @@ -147,10 +147,15 @@
>             *result |= RPMVERIFY_MD5;
>         else {
>             rc = domd5(filespec, md5sum, 1);
> -           if (rc)
> +            if (rc) {
>                 *result |= (RPMVERIFY_READFAIL|RPMVERIFY_MD5);
> -           else if (strcmp(md5sum, md5List[filenum]))
> +                fprintf(stderr, "md5sum read failure for %s: (%s)
> headers vs. (%s) file - %m\n",
> +                        filespec, md5sum, md5List[filenum]);
> +            } else if (strcmp(md5sum, md5List[filenum])) {
>                 *result |= RPMVERIFY_MD5;
> +                fprintf(stderr, "md5sum mismatch for %s: (%s) headers
> vs. (%s) file\n",
> +                        filespec, md5sum, md5List[filenum]);
> +            }
>         }
>         md5List = hfd(md5List, mdt);
>      }
> 
> Now, with rpm -Va a few thousand times, I get one failure:
> 
> md5sum mismatch for /usr/lib/libgmp.so.2.0.2:
> (b009459132ff2ae89747ce284c36bbd7) headers vs.
> (eea415cb7364b72eb7098b8bff4d7eff) file
> ..5.....   /usr/lib/libgmp.so.2.0.2
> 
> When the failure goes away, and I verify again using the md5sum program,
> I see that
> 
> eea415cb7364b72eb7098b8bff4d7eff
> 
> is the correct checksum.  So, for a brief moment, rpm has the wrong
> md5sum in its database.
> 
> Is this helpful at all?

Yes, very. I'm much more inclined to believe that there's an rpm problem
here.

You might try using db-4.1.24. It's on the rpm-4_0 branch from CVS:

	cvs -d :pserver:anonymous@cvs.rpm.org:/cvs/devel login
	(no password, just carriage return)
	cvs -d :pserver:anonymous@cvs.rpm.org:/cvs/devel get rpm
	cd rpm
	cvs up -r rpm-4_0
	cd rpm/db
	cvs up -A -d
	cd ..

Edit autogen.sh to fiddle libtool et al, and make sure --enable-posixmutexes
is not set (shouldn't be unless you somehow have nptl-devel installed for
some bizarre reason). Then
	./autogen.sh
	make

> 
> I'm currently rerunning tests with rpm-4.1 to see if it was fixed along
> the way.

rpm-4.1 uses db-4.0.14, but rpmdb/rpmdb.c has been reworked to dump db1,
is much closer to the Berkeley DB API.

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] []