Bug 41864

Summary: rpm-4.0.2-6x free list corrupt
Product: [Retired] Red Hat Linux Reporter: Michael Morrison <mmorrison>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED WORKSFORME QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2CC: l_magnus_j
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-05-23 19:05:45 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:
Attachments:
Description Flags
RPM database... (I think). tarball of /var/lib/rpm none

Description Michael Morrison 2001-05-22 17:49:05 UTC
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 18:33:28 UTC
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 20:19:44 UTC
rpm version 4.0.2-6x
I have occasionally used the ximian installer.


Comment 3 Jeff Johnson 2001-05-23 16:40:49 UTC
Pointer to a tar ball of your database, please, and I'll send ya a fix ...

Comment 4 Michael Morrison 2001-05-23 17:55:08 UTC
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 18:58:42 UTC
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 19:05:39 UTC
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 22:40:16 UTC
Bug Fixed

Comment 8 Michael Morrison 2001-05-23 22:41:17 UTC
Thanks for the help.  I really appreciate it!

Comment 9 Jeff Johnson 2001-05-30 19:41:58 UTC
*** Bug 42283 has been marked as a duplicate of this bug. ***

Comment 10 Magnus Johansson 2001-05-31 03:50:10 UTC
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 13:59:10 UTC
to l_magnus_j: Yes, your problem is still unresolved. Working on it
...

Comment 12 Magnus Johansson 2001-06-15 01:33:09 UTC
Any news on the segmentation fault problem?

Regards
Magnus

Comment 13 Jeff Johnson 2001-06-15 04:39:17 UTC
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-06 02:03:22 UTC
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