Bug 41864 - rpm-4.0.2-6x free list corrupt
rpm-4.0.2-6x free list corrupt
Status: CLOSED WORKSFORME
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
6.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-05-22 13:49 EDT by Michael Morrison
Modified: 2007-04-18 12:33 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-05-23 15:05:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
RPM database... (I think). tarball of /var/lib/rpm (deleted)
2001-05-22 16:10 EDT, Michael Morrison
no flags Details

  None (edit)
Description Michael Morrison 2001-05-22 13:49:05 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (Windows NT 5.0; U)

Description of problem:
While installing a package I got the message:
error: free list corrupt (10514888)- please run "rpm --rebuilddb"

If I run "rpm --rebuilddb"  I just get the same error message.
If I run "rpm -qa" a number of package names are listed, then the same error message.

I looked at mailing list archives and found many similar problems reported, but It seems that
the stock answer is to rebuild the db. 

How reproducible:
Always

Steps to Reproduce:
1. run "rpm --rebuilddb"
2.
3.
	

Actual Results:  Get error message "error: free list corrupt (10514888)- please run "rpm --rebuilddb" ...

Expected Results:  db correctly rebuilt

Additional info:
Comment 1 Jeff Johnson 2001-05-22 14:33:28 EDT
What version of rpm?
If you've been using the Ximian installer, I supect I know the problem.
If so, please attach a pointer to a tarball of your database
	cd /var/lib
	tar czvf /tmp/rpmdb.tar.gz
and I'll take a look.
Comment 2 Michael Morrison 2001-05-22 16:19:44 EDT
rpm version 4.0.2-6x
I have occasionally used the ximian installer.
Comment 3 Jeff Johnson 2001-05-23 12:40:49 EDT
Pointer to a tar ball of your database, please, and I'll send ya a fix ...
Comment 4 Michael Morrison 2001-05-23 13:55:08 EDT
The tarball was attached using the bugzilla form.

Also, you can get it from http://www.tempori.com/files

It's called rpmdb.tar.gz.

Comment 5 Jeff Johnson 2001-05-23 14:58:42 EDT
Hmmm, yopu're still using db1, that means that the data corruption will be more
severe,
causing all packages after the break in the chain to be lost, ...

Here's what to do:

1) Get a copy of rpm-3.0.x installed manually using rpm2cpio
	mkdir /var/tmp/xxx
	cd /var/tmp/xxx
	rpm2cpio rpm-3.0*.rpm | cpio -dim

2) Rebuild using rpm-3.0.5 to get rid of the freelist corruption
	cd /var/tmp/xxx
	./bin/rpm --rebuilddb

3) Rebuild using rpm-4.0.2 to convert from db1 -> db3
	/bin/rpm --rebuilddb -vv

4) Verify that everything's OK by doing rpm -qa and whatever else ...

5) Check for orphaned files, i.e. files from packages whose header has
been lost. The technique is basically
	for i in /bin /sbin /usr/bin /usr/sbin /usr/X11R6/bin ...
	do
	    rpm -qf $i/* | grep 'not owned'
	done
and then finding what package used to own the file (you need the rpmdb-redhat
package)
	rpm --redhatprovides --dbapi 1 <orphan_file_here>

Comment 6 Jeff Johnson 2001-05-23 15:05:39 EDT
Here's some more info about your rpmdb that might help.

The damage is at (or near) offset 13547416 decimal in packages.rpm. Since
bash$ ls -al /var/lib/rpm/packages.rpm 
-rw-r--r--    1 root     root     13560328 May 21 12:39
/var/lib/rpm/packages.rpm

you probably have lost very little information.

HTH. Reopen this bug if you need more.
Comment 7 Michael Morrison 2001-05-23 18:40:16 EDT
Bug Fixed
Comment 8 Michael Morrison 2001-05-23 18:41:17 EDT
Thanks for the help.  I really appreciate it!
Comment 9 Jeff Johnson 2001-05-30 15:41:58 EDT
*** Bug 42283 has been marked as a duplicate of this bug. ***
Comment 10 Magnus Johansson 2001-05-30 23:50:10 EDT
I tried the steps above, and I'm getting segmentation fault performing the last step:  /bin/rpm --rebuilddb -vv

D:   +++        254 dos2unix-3.1-3
D: adding "dos2unix" to Name index.
D: adding 6 entries to Basenames index.
D: adding "Applications/Text" to Group index.
D: adding 4 entries to Requirename index.
D: adding 1 entries to Providename index.
Segmentation fault


$ rpm --version
RPM version 4.0.2

RH 6.2
Comment 11 Jeff Johnson 2001-05-31 09:59:10 EDT
to l_magnus_j@yahoo.com: Yes, your problem is still unresolved. Working on it
...
Comment 12 Magnus Johansson 2001-06-14 21:33:09 EDT
Any news on the segmentation fault problem?

Regards
Magnus
Comment 13 Jeff Johnson 2001-06-15 00:39:17 EDT
FIxed in rpm-4.0.3-0.38, you need to do a --rebuilddb. Thanks for your patience,
I'll make a copy available on ftp.rpm.org in the next couple days.
Comment 14 Magnus Johansson 2001-07-05 22:03:22 EDT
Does this problem occur on RH 7.1?

I searched the database, and it looks like it's only 6.2 that has this problem.
Can anyone confirm this?

Thanks
Magnus

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