Bug 38454 - RPM 4.0.2-7x database corruption
RPM 4.0.2-7x database corruption
Status: CLOSED WORKSFORME
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
David Lawrence
:
: 40066 41054 41793 55396 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-04-30 15:31 EDT by redhat-bugs
Modified: 2007-04-18 12:32 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-05-06 21:13:05 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)
tarball of the RPM database causing this trouble (4.55 MB, application/octet-stream)
2001-05-06 14:16 EDT, redhat-bugs
no flags Details
t38454.c will delete bad records (1.50 KB, patch)
2001-05-06 21:13 EDT, Jeff Johnson
no flags Details | Diff

  None (edit)
Description redhat-bugs 2001-04-30 15:31:55 EDT
As per Jeff Johnson's at 
http://www.geocrawler.com/lists/3/Red-Hat-Linux/87/0/5656728/

I am having a problem with a corrupt RPM database shortly after upgrading
my rpm to the 4.0.2-7x rpm.  When trying various opertations including
trying to rebuild the database I get the following error:

# rpm --rebuilddb
rpmdb: header.c:241: regionSwab: Assertion `ie.info.type >= 0 &&
ie.info.type <= 9' failed.
Aborted (core dumped)

I do get the same problem after upgrading to the rpm-4.0.3 specified in the
e-mail in the link above.
Comment 1 Jeff Johnson 2001-05-06 10:26:00 EDT
Can you attach a tar ball of your database
	cd /var/lib
	tar czvf /tmp/rpmdb-38454.tar.gz rpm
to this bug, and I'll take a look? Thanks.
Comment 2 redhat-bugs 2001-05-06 14:16:08 EDT
Created attachment 17486 [details]
tarball of the RPM database causing this trouble
Comment 3 Jeff Johnson 2001-05-06 19:49:58 EDT
Here's the start of the problem. The script
	cd /var/lib/rpm
	for i in *
	do
		echo $i ----
		db_verify $i
	done
gives output:

db_verify: First overflow page 2814 has a prev_pgno
db_verify: Overflow item incomplete on page 2862
db_verify: Overflow page 2814 has bogus prev_pgno value
db_verify: Page 2814 encountered twice in overflow traversal
db_verify: First overflow page 2814 has a prev_pgno
db_verify: Page 2814 encountered twice in overflow traversal
db_verify: First overflow page 2814 has a prev_pgno
db_verify: Page 2814 encountered twice in overflow traversal
db_verify: First overflow page 2814 has a prev_pgno
db_verify: Page 2814 encountered twice in overflow traversal
db_verify: First overflow page 2814 has a prev_pgno
db_verify: Page 2814 encountered twice in overflow traversal
db_verify: DB->verify: Packages.old: DB_VERIFY_BAD: Database verification failed

Fix or workaround coming in a bit ...
Comment 4 Jeff Johnson 2001-05-06 21:11:19 EDT
OK, you have several bad records, all occurred someplace near
...
kernel-2.2.19-7.0.1.2.2mvd                    Wed 25 Apr 2001 10:14:38 PM EDT
up2date-gnome-2.5.4-1                         Wed 25 Apr 2001 10:09:50 PM EDT
up2date-2.5.4-1                               Wed 25 Apr 2001 10:09:45 PM EDT
rhn_register-gnome-1.3.2-1                    Wed 25 Apr 2001 10:09:44 PM EDT
rhn_register-1.3.2-1                          Wed 25 Apr 2001 10:09:43 PM EDT
python-xmlrpc-1.4-1                           Wed 25 Apr 2001 10:09:42 PM EDT
========== HERE =============
abisuite-0.7.13-ximian.6                      Wed 25 Apr 2001 06:06:11 PM EDT
gnome-audio-1.4.0-ximian.1                    Wed 25 Apr 2001 06:06:05 PM EDT
gnome-audio-1.0.0-12                          Wed 25 Apr 2001 06:06:03 PM EDT
abisuite-0.7.13-ximian.6                      Wed 25 Apr 2001 06:04:53 PM EDT
nautilus-trilobite-1.0.1.1-ximian.12          Wed 25 Apr 2001 05:57:25 PM EDT

Here's how to fix:

1) Fix the database damage (and save a copy) by doing (as root, you need
db3-utils)
	cd /var/lib/rpm
	mv Packages Packages.old
	db_dump Packages.old | db_load Packages

2) Get a copy of the attached toy program, and compile by doing (you need
db3-devel)
	cc -o t38454 t38454.c -ldb-3.1

3) Run the program as root
	t38454

4) Do a rpm -qa, then a rpm --rebuilddb.


	
Comment 5 Jeff Johnson 2001-05-06 21:13:02 EDT
Created attachment 17528 [details]
t38454.c will delete bad records
Comment 6 Jeff Johnson 2001-05-06 21:23:46 EDT
Reopen the bug if you need more ...
Comment 7 redhat-bugs 2001-05-07 00:54:52 EDT
Works great!

Thanks Jeff!
Comment 8 Jeff Johnson 2001-05-11 18:28:27 EDT
*** Bug 40066 has been marked as a duplicate of this bug. ***
Comment 9 Jeff Johnson 2001-05-23 11:12:24 EDT
*** Bug 41793 has been marked as a duplicate of this bug. ***
Comment 10 Jeff Johnson 2001-05-23 13:06:36 EDT
*** Bug 41054 has been marked as a duplicate of this bug. ***
Comment 11 Jeff Johnson 2001-11-04 10:51:14 EST
*** Bug 55396 has been marked as a duplicate of this bug. ***

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