Bug 59088

Summary: RPM 4.0.3 and 4.0.4 segfaulting at a probably corrupt database
Product: [Retired] Red Hat Linux Reporter: Roberto Bagnara <bagnara>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: bagnara
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
URL: http://www.cs.unipr.it/~bagnara/rpmdb.tar.gz
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-01-30 19:26:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Roberto Bagnara 2002-01-30 19:26:53 UTC
Description of Problem:

after doing `rpm -Fvh some-packages' I got a message saying something
about the database being not in good shape.  Then I tried to rebuild
the database, but I get

# rpm --rebuilddb
error: rpmdb: damaged header instance #266 retrieved, skipping.
error: rpmdb: damaged header instance #278 retrieved, skipping.
error: rpmdb: damaged header instance #312 retrieved, skipping.
error: rpmdb: damaged header instance #794 retrieved, skipping.
error: rpmdb: damaged header instance #834 retrieved, skipping.
error: rpmdb: damaged header instance #878 retrieved, skipping.
error: rpmdb: damaged header instance #886 retrieved, skipping.
error: rpmdb: damaged header instance #954 retrieved, skipping.
error: rpmdb: damaged header instance #980 retrieved, skipping.
error: rpmdb: damaged header instance #1043 retrieved, skipping.
Segmentation fault
# rpm -q rpm
rpm-4.0.3-1.03

I have also tried with version 4.0.4 which gives me a slightly
more informative message

# ./rpm --rebuilddb
error: rpmdb: damaged header instance #266 retrieved, skipping.
error: rpmdb: damaged header instance #278 retrieved, skipping.
error: rpmdb: damaged header instance #312 retrieved, skipping.
error: rpmdb: damaged header instance #794 retrieved, skipping.
error: rpmdb: damaged header instance #834 retrieved, skipping.
error: rpmdb: damaged header instance #878 retrieved, skipping.
error: rpmdb: damaged header instance #886 retrieved, skipping.
error: rpmdb: damaged header instance #954 retrieved, skipping.
error: rpmdb: damaged header instance #980 retrieved, skipping.
error: rpmdb: damaged header instance #1043 retrieved, skipping.
*** dbiUpdateRecord: uh is NULL
Segmentation fault

Comment 1 Jeff Johnson 2002-01-30 23:36:01 UTC
Hmmm, something else is going on, as rpm --rebuilddb worked
flawlessly for me.

There's a tarball of your rebuilt database at
	ftp://people.redhat.com/jbj/rpmdb-59088-FIX.tar.gz
if that helps. Do
	cd /var/lib
	mv rpm rpm-SAVE
	tar xzvf rpmdb-59088-FIX.tar.gz
to replace. An rpm -qa is a pretty good check, try a rpm --rebuilddb -vv
as well.