Bug 38454 - RPM 4.0.2-7x database corruption
Summary: RPM 4.0.2-7x database corruption
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm   
(Show other bugs)
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
: 40066 41054 41793 55396 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-04-30 19:31 UTC by redhat-bugs
Modified: 2007-04-18 16:32 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-05-07 01:13:05 UTC
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 18:16 UTC, redhat-bugs
no flags Details
t38454.c will delete bad records (1.50 KB, patch)
2001-05-07 01:13 UTC, Jeff Johnson
no flags Details | Diff

Description redhat-bugs 2001-04-30 19:31:55 UTC
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 14:26:00 UTC
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 18:16:08 UTC
Created attachment 17486 [details]
tarball of the RPM database causing this trouble

Comment 3 Jeff Johnson 2001-05-06 23:49:58 UTC
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-07 01:11:19 UTC
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-07 01:13:02 UTC
Created attachment 17528 [details]
t38454.c will delete bad records

Comment 6 Jeff Johnson 2001-05-07 01:23:46 UTC
Reopen the bug if you need more ...

Comment 7 redhat-bugs 2001-05-07 04:54:52 UTC
Works great!

Thanks Jeff!

Comment 8 Jeff Johnson 2001-05-11 22:28:27 UTC
*** Bug 40066 has been marked as a duplicate of this bug. ***

Comment 9 Jeff Johnson 2001-05-23 15:12:24 UTC
*** Bug 41793 has been marked as a duplicate of this bug. ***

Comment 10 Jeff Johnson 2001-05-23 17:06:36 UTC
*** Bug 41054 has been marked as a duplicate of this bug. ***

Comment 11 Jeff Johnson 2001-11-04 15:51:14 UTC
*** 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.