Bug 83537

Summary: rpm produces segmentation faults on (de-)installations
Product: [Retired] Red Hat Linux Reporter: Robert Hoekstra <bugzilla>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED NOTABUG QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
URL: http://robert.hoekstra.nu/segfault.txt
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-02-06 20:26:43 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:

Description Robert Hoekstra 2003-02-05 13:59:07 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

Description of problem:
Once, during installation of a package, rpm hung (no cpu usage for a long 
time). So I killed it with the -KILL signal.

rpm kept hanging, so I used the site http://www.rpm.org/hintskinks/repairdb/ 
to try and repair my rpm database. It also said that if the page wouldn't work 
out, I would have to enter a bug report.

All suggestions on the site don't bring a solution.

Also the site tells there is NO situation in which the rpm database is beyond 
repair (I didn't delete files except __db*)

rpm -qa works fine, but (de-)installing is impossible, no matter what package 
I want to (de-)install.

I am willing to provide any (relative) information you need in order to figure 
this out.

I am using RH 8.0 with it's default rpm package. 'rpm -V rpm' comes with no 
errors at all.

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


How reproducible:
Didn't try


Actual Results:  Segmentation fault

Expected Results:  Correct (de-)installation of packages

Additional info:

Comment 1 Jeff Johnson 2003-02-05 15:00:02 UTC
What does (from db4-utils packg)
    /usr/bin/db_verify /var/lib/rpm/Packages
say?

Otherwise I need a pointer (i.e. URL, attacments won't work)
to a tarball of your database:
    cd /var/lib
    tar czvf /tmp/rpmdb-83537.tar.gz rpm


Comment 2 Robert Hoekstra 2003-02-05 16:04:36 UTC
/usr/bin/db_verify /var/lib/rpm/Packages doesn't report any errors. 
I even renamed Packages to Packages-BROKEN and tried: 
'db_dump Packages-BROKEN | db_load Packages' 
Produced exactly same-sized Packages file. no changes afterwards.. 
 
Check http://www.xs4all.nl/~rhoekst/rpmdb-83537.tar.gz for my database. 
 
I hope you are able to reproduce. If not, I would like to hear what tips you have to 
help me..  
 
'rpm -K  nc-1.10-16.i386.rpm' resulted in an OK status. 
'rpm -V rpm' went okay as well 

Comment 3 Jeff Johnson 2003-02-05 16:39:14 UTC
Running "rpm --rebuilddb -vv" twice worksforme.

Dunno why "twice", the 1st rebuild errors with

D:  read h#     478 Header SHA1 digest: OK
(90415e835778e71eaa2f37cfe5b87682bf584149)
D:   +++ h#     359 Header SHA1 digest: OK
(90415e835778e71eaa2f37cfe5b87682bf584149)
D: adding "perl-IO-Multiplex" to Name index.
D: adding 7 entries to Basenames index.
D: adding "Applications/CPAN" to Group index.
D: adding 12 entries to Requirename index.
D: adding 3 entries to Providename index.
D: adding 5 entries to Dirnames index.
D: adding 12 entries to Requireversion index.
D: adding 3 entries to Provideversion index.
D: adding 1 entries to Installtid index.
D: adding 1 entries to Sigmd5 index.
D: adding "90415e835778e71eaa2f37cfe5b87682bf584149" to Sha1header index.
D: adding 7 entries to Filemd5s index.
rpmdb: page 2724: illegal page type or format
rpmdb: PANIC: Invalid argument
error: db4 error(-30981) from dbcursor->c_get: DB_RUNRECOVERY: Fatal error, run
database recovery
error: db4 error(-30981) from dbcursor->c_close: DB_RUNRECOVERY: Fatal error,
run database recovery
error: db4 error(-30981) from db->close: DB_RUNRECOVERY: Fatal error, run
database recovery
D: closed   db index       /var/lib/rpm/Packages
error: db4 error(-30981) from dbenv->close: DB_RUNRECOVERY: Fatal error, run
database recovery
D: closed   db environment /var/lib/rpm/Packages
error: db4 error(-30981) from db_env_create: DB_RUNRECOVERY: Fatal error, run
database recovery
error: db4 error(-30981) from dbenv->remove: DB_RUNRECOVERY: Fatal error, run
database recovery
D: removed  db environment /var/lib/rpm/Packages

Does 2 rebuild's work for you?


Comment 4 Robert Hoekstra 2003-02-06 18:22:35 UTC
The first rebuild indeed produces a panic, also with me..
The second rebuild indeed finishes without problems.

Though.. I am still unable to install packages.. still get the segmentation fault


Comment 5 Jeff Johnson 2003-02-06 18:28:02 UTC
Are you using LDAP passwords? If so, make sure that
nscd is running
    /sbin/service nscd start

Otherwise, add -vv to an install, attach output here.

Comment 6 Robert Hoekstra 2003-02-06 20:26:43 UTC
Ahh boooh...

It works again.

You're right. I installed LDAP for authentication yesterday, but never thought
of conflicts with rpm!

So it isn't a bug.. thanks very much.. the problem is solved now..
Not sure why it doesn't work without nscd, nor why it works on my RedHat 7.2
machine (also LDAP, never had problems).

Thanks very much anyway.
(I looked up documentation for rpm, but it doesn't tell about it, unfortunately)