Bug 60152 - rpm --rebuilddb spins in a loop.
Summary: rpm --rebuilddb spins in a loop.
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm
Version: 7.3
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
URL: http://www.email-scan.com/rpm.bad.tar.gz
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-02-20 23:56 UTC by Sam Varshavchik
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-02-20 23:56:43 UTC
Embargoed:


Attachments (Terms of Use)

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.


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