Bug 51836

Summary: RPM db bad
Product: [Retired] Red Hat Linux Reporter: Kim Bisgaard <kim-rh>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED WORKSFORME QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
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-08-29 06:43:20 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
/var/lib/rpm none

Description Kim Bisgaard 2001-08-15 18:04:14 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010802

Description of problem:
rpm seg.faults I have done a db_verify Packages:
db_verify: Overflow page 2463 of invalid type
db_verify: DB->verify: Packages.old.2: DB_VERIFY_BAD: Database verification
failed

Version-Release number of selected component (if applicable):
rpm-4.0.2-8

How reproducible:
Always

Steps to Reproduce:
1.db_verify /var/lib/rpm/Packages
2.
3.
	

Actual Results:  db_verify: Overflow page 2463 of invalid type
db_verify: DB->verify: Packages.old.2: DB_VERIFY_BAD: Database verification
failed

Additional info:

Comment 1 Kim Bisgaard 2001-08-15 19:22:03 UTC
I have tried to upload (attach) a tar of the /var/lib/rpm dir, but modem, isp,
Mozilla og bugzilla won't play ball - sorry.

Comment 2 Kim Bisgaard 2001-08-15 20:18:08 UTC
Created attachment 28016 [details]
/var/lib/rpm

Comment 3 Jeff Johnson 2001-08-15 20:41:38 UTC
Recreate Packages using db_dump/db_load:

	cd /var/lib/rpm
	mv Packages Packages-ORIG
	db_dump Packages-ORIG | db_load Packages

Comment 4 Kim Bisgaard 2001-08-16 15:33:41 UTC
Ok I have already tried that, but when I do a rpm -qa I get:
ZIP .... ZIP
kernel-2.4.2-2
portmap-4.0-35
pump-0.8.11-1
VFlib2-2.25.1-12
ypbind-1.7-6
autorun-2.65-1
Segmentation fault (core dumped)

I have tried to run the litle program you made for another similiar bug, to
delete bad records. It outputs:
fix record[0] at #562 --
db: get key: 0xbffffa30[4] = 0x232, data at 0x804e2c0[5352].
db: del key: 0xbffffa30[4] = 0x232, data at 0x804e2c0[5352].
fix record[1] at #566 --
db: get key: 0xbffffa30[4] = 0x236, data at 0x804e2c0[5940].
db: del key: 0xbffffa30[4] = 0x236, data at 0x804e2c0[5940].
fix record[2] at #559 --
db: get key: 0xbffffa30[4] = 0x22f, data at 0x804e2c0[5644].
db: del key: 0xbffffa30[4] = 0x22f, data at 0x804e2c0[5644].
fix record[3] at #561 --
db: get key: 0xbffffa30[4] = 0x231, data at 0x804e2c0[3200].
db: del key: 0xbffffa30[4] = 0x231, data at 0x804e2c0[3200].
fix record[4] at #563 --
db: get key: 0xbffffa30[4] = 0x233, data at 0x804e2c0[8212].
db: del key: 0xbffffa30[4] = 0x233, data at 0x804e2c0[8212].
fix record[5] at #560 --
db: get key: 0xbffffa30[4] = 0x230, data at 0x804e2c0[14404].
db: del key: 0xbffffa30[4] = 0x230, data at 0x804e2c0[14404].
fix record[6] at #564 --
db: get key: 0xbffffa30[4] = 0x234, data at 0x804e2c0[9576].
db: del key: 0xbffffa30[4] = 0x234, data at 0x804e2c0[9576].

but rpm -qa still seg.faults at the same place.

rpm -vv -rebuilddb goes:
ZIP ... ZIP
D:   +++        350 ypbind-1.7-6
D: adding "ypbind" to Name index.
D: adding 9 entries to Basenames index.
D: adding "System Environment/Daemons" to Group index.
D: adding 21 entries to Requirename index.
D: adding 1 entries to Providename index.
D:   +++        351 autorun-2.65-1
D: adding "autorun" to Name index.
D: adding 11 entries to Basenames index.
D: adding "Applications/System" to Group index.
D: adding 9 entries to Requirename index.
D: adding 1 entries to Providename index.
Segmentation fault (core dumped)

Comment 5 Jeff Johnson 2001-08-16 15:38:34 UTC
OK, give me a pointer (i.e. URL, bugzilla attachments won't work) to a tarball
of your database
	cd /var/lib
	tar czvf /tmp/rpmdb3-51836.tar.gz rpm
and I'll figger what's up.

Comment 6 Kim Bisgaard 2001-08-16 15:42:59 UTC
I will get you one tomorrow, but why does bugzilla attachment not work - what
use is it then??

Comment 7 Jeff Johnson 2001-08-16 15:44:23 UTC
Attachments work fine, but can't handle 5Mb+ rpm databases.

Comment 8 Kim Bisgaard 2001-08-17 06:37:33 UTC
The bzip2'ed tar of /var/lib/rpm can now be found at:
ftp://ftp.dmi.dk/pub/oersted/rpm.tar.bz2

Comment 9 Kim Bisgaard 2001-08-29 06:43:16 UTC
Hi jbj,

I am aware that this could possibly be a bug that you are not obliged to
correct, and I am thankful that you have offered to correct it anyway. Is there
anything I could do, to get around this bug? Some db editing tools around so
that I can correct my db myself?

Best regards,

Comment 10 Jeff Johnson 2001-08-30 13:01:30 UTC
Sorry for the delay, I lost you in the MODIFIED state.

I've repaired (by doing a rpm --rebuilddb with rpm-4.0.3)
your database. Your rpm/Packages file and a log are at
	ftp://people.redhat.com/jbj/rpmdb3-51836-FIX.tar.gz
Do the following
	cd /var/lib/rpm
	mv Packages Packages-ORIG
	cd ..
	tar xzvf rpmdb3-51836-FIX.tar.gz
	rpm --rebuilddb