Bug 128649

Summary: rpm hangs while upgrading/removing packages. Doesn't even respond to kill -9
Product: [Fedora] Fedora Reporter: Need Real Name <cheng>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED NOTABUG QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 2CC: nobody+pnasrat
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-07-27 18:21:40 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 Need Real Name 2004-07-27 18:02:22 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1)
Gecko/20020921 Netscape/7.0

Description of problem:
I have a freshly installed (and updated with yum) Fedora Core 2 on an
dual Intel Xeon system.  I tried to upgrade gmp and gmp-devel to 4.1.3
and that requires a newer libstdc++, so I tried to install (not
upgrade) libstdc++ from the new Fedora development branch (I found it
on rpmfind.net) with:

  rpm -ivh libstdc++-...rpm

The rpm process hung and used up one CPU, and I cannot kill it no
matter what I tried.  Even kill -9 as root does not work.  I
eventually had to press the power button and reboot the machine.

After I rebooted the machine, I removed /var/lib/rpm/__db* and did a
rpm --rebuilddb.  I noticed that it did install the new packages...so
I proceeded to upgrade gmp and gmp-devel.  So far so good.

But then I decided to remove the new libstdc++ and downgrade gmp back
to the way it was.  Here is what I got:

[root@nox cheng]# rpm -vv -e gmp gmp-devel
D: opening  db environment /var/lib/rpm/Packages joinenv
D: opening  db index       /var/lib/rpm/Packages rdonly mode=0x0
D: locked   db index       /var/lib/rpm/Packages
D: opening  db index       /var/lib/rpm/Name rdonly mode=0x0
D: opening  db index       /var/lib/rpm/Pubkeys rdonly mode=0x0
D:  read h#     160 Header V3 DSA signature: NOKEY, key ID 30c9ecf8
D:  read h#     480 Header V3 DSA signature: NOKEY, key ID 30c9ecf8
D: ========== --- gmp-4.1.3-2 i386/linux 0x1
D: opening  db index       /var/lib/rpm/Requirename rdonly mode=0x0
D:  read h#     394 Header sanity check: OK
D: ========== DSA pubkey id b44269d04f2a6fd2
D:  read h#      50 Header V3 DSA signature: OK, key ID 4f2a6fd2
D: opening  db index       /var/lib/rpm/Depends create mode=0x0
D: opening  db index       /var/lib/rpm/Providename rdonly mode=0x0
D:  Requires: libgmp.so.3                                   NO  
D: package python-2.3.3-6 has unsatisfied Requires: libgmp.so.3
D: ========== --- gmp-devel-4.1.3-2 i386/linux 0x0
D: closed   db index       /var/lib/rpm/Depends
error: Failed dependencies:
	libgmp.so.3 is needed by (installed) python-2.3.3-6
D: closed   db index       /var/lib/rpm/Pubkeys
D: closed   db index       /var/lib/rpm/Providename
D: closed   db index       /var/lib/rpm/Requirename
D: closed   db index       /var/lib/rpm/Name
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages
[root@nox cheng]# rpm -vv -e gmp gmp-devel --nodeps
D: opening  db environment /var/lib/rpm/Packages joinenv
D: opening  db index       /var/lib/rpm/Packages rdonly mode=0x0
D: locked   db index       /var/lib/rpm/Packages
D: opening  db index       /var/lib/rpm/Name rdonly mode=0x0
D: opening  db index       /var/lib/rpm/Pubkeys rdonly mode=0x0
D:  read h#     160 Header V3 DSA signature: NOKEY, key ID 30c9ecf8
D:  read h#     480 Header V3 DSA signature: NOKEY, key ID 30c9ecf8
D: closed   db index       /var/lib/rpm/Pubkeys
D: closed   db index       /var/lib/rpm/Name
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages
D: opening  db environment /var/lib/rpm/Packages joinenv
D: opening  db index       /var/lib/rpm/Packages create mode=0x42
D: mounted filesystems:
D:     i    dev bsize       bavail       iavail mount point
D:     0 0x0808  4096       179336        96641 /
D:     1 0x0003  4096            0           -1 /proc
D:     2 0x0000  4096            0           -1 /sys
D:     3 0x0009  4096            0           -1 /dev/pts
D:     4 0x000c  4096            0           -1 /proc/bus/usb
D:     5 0x0802  1024        87930        26174 /boot
D:     6 0x000e  4096      2047332      2047331 /dev/shm
D:     7 0x0811  4096     16704377      8961585 /home
D:     8 0x0809  4096      5920428      3178485 /home2
D:     9 0x0807  4096       231540       129788 /tmp
D:    10 0x0805  4096      1716728      1147740 /usr
D:    11 0x0806  4096       202802       127767 /var
D: sanity checking 2 elements
D: computing 35 file fingerprints
D: computing file dispositions
D: opening  db index       /var/lib/rpm/Basenames create mode=0x42
D: ========== --- gmp-devel-4.1.3-2 i386-linux 0x0
D:     erase: gmp-devel-4.1.3-2 has 18 files, test = 0
D: opening  db index       /var/lib/rpm/Name create mode=0x42
D: opening  db index       /var/lib/rpm/Pubkeys create mode=0x42
D:  read h#     480 Header V3 DSA signature: NOKEY, key ID 30c9ecf8
D: opening  db index       /var/lib/rpm/Triggername create mode=0x42
D:     erase: %preun(gmp-devel-4.1.3-2) asynchronous scriptlet start
D:     erase: %preun(gmp-devel-4.1.3-2)	execv(/bin/sh) pid 2137
+ '[' 0 = 0 ']'
+ /sbin/install-info --delete /usr/share/info/gmp.info.gz
/usr/share/info/dir

It hangs right here.  Nothing can be done to kill it.  kill -9 does
not respond at all.  Even /sbin/shutdown hangs and the only way to
kill it is by pressing the power button.  I tried to attach gdb to the
process to see what's going on, but gdb hangs!

How do a fix this short of a reinstall?

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

How reproducible:
Didn't try

Steps to Reproduce:
see above

Additional info:

Comment 1 Jeff Johnson 2004-07-27 18:21:40 UTC
If kill -9 does not terminate the process, then the process
is hung in the kernel, signals are handled on syscall exit.

Note that almost certainly something other than rpm is the
root cause of this problem. Look for other signs of, say,
hardware errors, memory failure, bleeding edge kernels,
software mis-matches, etc. Only you know what has recently
changed or happened on the machine.

Certainly there are fixes short of reinstall.

Reboot, by power cycling if necessary.

During reboot, the command
    rm -f /var/lib/rpm/__db*
will be run to remove stale locks that will always be left
behind after an execptional event like power cycling, or
kill -9 termintation.

Running
     rpm -qa --last | more
will show the most recent installs, some of which may
have not been completed.

Verify recent installs by doing
    rpm -V pkg1 pkg2
If verify reports no problems, then the pkgs are sucessfully
installed.

If there are problems, reinstall packages using
    rpm -Uvh --force pkg1*.rpm
to complete the install.