Bug 60152

Summary: rpm --rebuilddb spins in a loop.
Product: [Retired] Red Hat Linux Reporter: Sam Varshavchik <mrsam>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED RAWHIDE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 7.3   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
URL: http://www.email-scan.com/rpm.bad.tar.gz
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-02-20 23:56:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sam Varshavchik 2002-02-20 23:56:39 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020205

Description of problem:
Some kind of database corruption happened after a couple of rpm -Us. rpm -q
appears to work.  rpm -q -a works, rpm -q -l -vv works, but any
install/update/remove now reports the following error:

rpmdb: Suspiciously high nelem of 4294967295 on page 0
error: db4 error(-30979) from db->verify: DB_VERIFY_BAD: Database verification
failed

The error is usually reported at the end of the install/removal, and it looks
like the package install/remove actually went through, except for this error.

However it does not appear to be possible to fix the corruption: rpm --rebuilddb
now does some work, for a while, then strace shows it spinning in an infinite
mmap/munmap loop.  There is no apparent way to recover the database completely.

How reproducible:
Always

Steps to Reproduce:
1. Download http://www.email-scan.com/rpm.bad.tar.gz (8MB) into /var/lib/rpm
2. Run rpm --rebuilddb

	

Actual Results:  rpm runs for a while, rebuilds about half the packages, then
starts spinning in an infinite loop.

Expected Results:  The RPM database should be rebuilt as much as possible.

Comment 1 Jeff Johnson 2002-02-24 16:19:36 UTC
This isn't exactly damaged "beyond all repair"

There's a Berkeley db patch that was not included
in db-4.0.14, now reapplied in rpm-4.0.4 final.

Try doing
	rm /var/lib/rpm/__db*
	rpm --rebuilddb
If that doesn't fix your problem, attach a pointer
(bugzilla attachments won't work) to a tarball
of your database
	cd /var/lib
	tar czvf /tmp/rpmdb-60152.tar.gz rpm
and I'll take a look.

Comment 2 Sam Varshavchik 2002-02-24 16:43:21 UTC
I already tried rebuilddb after manually dropping __db files.  It doesn't work.


http://www.email-scan.com/rpm.bad.tar.gz (8MB)




Comment 3 Jeff Johnson 2002-02-24 16:53:29 UTC
Your database rebuilds fine here.

Add -vv and watch the progress.

Yes, there's a *lot* of entries in
the dev package, patience will out.