Bug 60152 - rpm --rebuilddb spins in a loop.
rpm --rebuilddb spins in a loop.
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jeff Johnson
Depends On:
  Show dependency treegraph
Reported: 2002-02-20 18:56 EST by Sam Varshavchik
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-02-20 18:56:43 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Sam Varshavchik 2002-02-20 18:56:39 EST
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

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:

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 11:19:36 EST
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 11:43:21 EST
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 11:53:29 EST
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.

Note You need to log in before you can comment on or make changes to this bug.