Bug 86410

Summary: Sometimes Segfaults in rpmdbFreeIterator
Product: [Retired] Red Hat Linux Reporter: Jon Burgess <jburgess777>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED RAWHIDE QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
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: 2003-03-22 20:02:49 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 Jon Burgess 2003-03-21 17:28:51 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312

Description of problem:
On RH8 I have been experiencing rpm hanging, so I updated to rpm-4.1.1-0.2.8x
from http://www.rpm.org/

This appears to have fixed the hang problem, but it seems to segfault duing some
operations (rpm -Fvh XX.rpm)


Version-Release number of selected component (if applicable):
rpm-4.1.1-0.2.8x 

How reproducible:
Sometimes

Steps to Reproduce:
1. I downloaded RPM's for KDE-3.1.1 from
ftp://download.uk.kde.org/pub/kde/stable/3.1.1/RedHat/8.0/i386

2. I started trying to update some packages and found that I needed to use
--nodeps to get some of the intermeadiate stuff to install before I could do and
"rpm -Fvh" on the bulk of the rpm's.
I think it was kdenetwork I installed:
rpm -ivh --nodeps kdenetwork-3.1.1...rpm

3. I tried to update the arts package and got a segfault, then I used gdb to get
a backtrace.


Actual Results:  The two packages I was trying to update were:
arts-1.1.1-0.8x.2.i386.rpm
arts-devel-1.1.1-0.8x.2.i386.rpm

GNU gdb Red Hat Linux (5.2.1-4)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(no debugging symbols found)...
(gdb) set args -Fvh arts*
(gdb) run
Starting program: /bin/rpm -Fvh arts*

Program received signal SIGSEGV, Segmentation fault.
0x0808f8b2 in rpmdbFreeIterator ()
(gdb) bt
#0  0x0808f8b2 in rpmdbFreeIterator ()
#1  0x0805536c in checkPackageSet ()
#2  0x080553c6 in checkDependentPackages ()
#3  0x08056da7 in rpmtsCheck ()
#4  0x08070b3d in rpmInstall ()
#5  0x08048e4c in main ()
#6  0x0816e172 in __libc_start_main ()
(gdb) q
The program is running.  Exit anyway? (y or n) y

Later I tried rebuilding the database with "rpm -vv --rebuilddb" and that too
segfaulted when it got to kdenetwork, so it made me think this was to blame.
Next I uninstalled it (and maybe specified --nodeps). Then I tried installing
arts with --nodeps and it worked.

I suspect that it is the broken dependencies caused by using "--nodeps" on
installing kdenetwork which provokes the segfaults, it might make sense since
the backtrace shows some evidence of trying to check dependencies when it crashes. 

If anyone else sees the problem they might try specifying --nodeps to see if it
avoids the problem.


Additional info:

Comment 1 Jon Burgess 2003-03-21 18:24:22 UTC
"apt-get update" also seg faults with a similar backtrace in librpmdb-4.1.so: 
 
Program received signal SIGSEGV, Segmentation fault. 
[Switching to Thread 16384 (LWP 3347)] 
0x40157122 in rpmdbFreeIterator () from /usr/lib/librpmdb-4.1.so 
(gdb) bt 
#0  0x40157122 in rpmdbFreeIterator () from /usr/lib/librpmdb-4.1.so 
#1  0x400a1765 in RPMDBHandler::RPMDBHandler(bool) () from 
/usr/lib/libapt-pkg-libc6.3-5.so.3.3 
#2  0x400c3812 in rpmSystem::Lock() () from /usr/lib/libapt-pkg-libc6.3-5.so.3.3 
#3  0x40086444 in pkgCacheFile::BuildCaches(OpProgress&, bool) () from 
/usr/lib/libapt-pkg-libc6.3-5.so.3.3 
#4  0x0805440b in DoUpdate(CommandLine&) () 
#5  0x40057adb in CommandLine::DispatchArg(CommandLine::Dispatch*, bool) () from 
/usr/lib/libapt-pkg-libc6.3-5.so.3.3 
#6  0x0805ac89 in main () 
#7  0x420158c7 in __libc_start_main () from /lib/i686/libc.so.6 
(gdb) 
 
 

Comment 2 Jeff Johnson 2003-03-22 20:02:49 UTC
FIxed, bits at same place you got the broken bits.