Bug 228463 - rpm loops when trying to update packages
Summary: rpm loops when trying to update packages
Keywords:
Status: CLOSED DUPLICATE of bug 213963
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-02-13 08:28 UTC by Kasper Dupont
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-07-17 12:58:40 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Kasper Dupont 2007-02-13 08:28:21 UTC
Description of problem:
I tryed to update gd using the rpm command, and it entered an infinite loop.

Version-Release number of selected component (if applicable):
rpm-4.4.2-15.2.i386.rpm

How reproducible:
Doesn't happen every time, but rpm and yum very often shows beahvior similar to
this.

Steps to Reproduce:
Just using rpm seems to be enough to reproduce the problem every now and then.
The steps I did this time was as follows:
1. rpm -Fvh gd-2.0.33-7.fc5.i386.rpm nspr-4.6.4-0.5.fc5.i386.rpm
  
Actual results:
rpm enters an infinite loop producing no output whatsoever

Expected results:
rpm installs the updated gd package

Additional info:
strace on the process produces no output, top shows it is using most of the CPU
time and the CPU spend most of its time in user mode. That typically means the
process is looping inside some user mode code, which makes no system calls.
Attaching gdb to the process produces output ending with this:

Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libsetrans.so.0...done.
Loaded symbols for /lib/libsetrans.so.0
__db_shalloc_rpmdb (infop=0x94db998, len=4223, align=Variable "align" is not
available.
) at ../db/dist/../env/db_salloc.c:177
177     ../db/dist/../env/db_salloc.c: No such file or directory.
        in ../db/dist/../env/db_salloc.c
(gdb) 

Using the bt command produces this:

(gdb) bt
#0  __db_shalloc_rpmdb (infop=0x94db998, len=4223, align=Variable "align" is not
available.
) at ../db/dist/../env/db_salloc.c:177
#1  0x00395411 in __memp_alloc_rpmdb (dbmp=0x94db948, infop=0x94db998,
mfp=0xb7d914f8, len=4223, offsetp=0x0, retp=0xbfd92488)
    at ../db/dist/../mp/mp_alloc.c:88
#2  0x00396a80 in __memp_fget_rpmdb (dbmfp=0x94dbd50, pgnoaddr=0xbfd9250c,
flags=0, addrp=0xbfd924e8)
    at ../db/dist/../mp/mp_fget.c:369
#3  0x00367850 in __db_goff_rpmdb (dbp=0x94dba38, dbt=0x94e2334, tlen=134740,
pgno=806, bpp=0x94dfb4c, bpsz=0x94dfb54)
    at ../db/dist/../db/db_overflow.c:147
#4  0x0036f15d in __db_ret_rpmdb (dbp=0x94dba38, h=0xb7d1966c, indx=171,
dbt=0x94e2334, memp=0x94dfb4c, memsize=0x94dfb54)
    at ../db/dist/../db/db_ret.c:50
#5  0x0035a48d in __db_c_get_rpmdb (dbc_arg=0x94dfb00, key=0x94e231c,
data=0x94e2334, flags=Variable "flags" is not available.
) at ../db/dist/../db/db_cam.c:778
#6  0x00360946 in __db_c_get_pp_rpmdb (dbc=0x94dfb00, key=0x94e231c,
data=0x94e2334, flags=28)
    at ../db/dist/../db/db_iface.c:1741
#7  0x002f0946 in db3cget (dbi=0x94db490, dbcursor=0x94dfb00, key=0x94e231c,
data=0x94e2334, flags=28) at db3.c:612
#8  0x002eb66d in rpmdbNextIterator (mi=0x94e2300) at rpmdb.h:591
#9  0x00690ccd in unsatisfiedDepend (ts=0x94d7a18, dep=0x94db038, adding=1) at
depends.c:528
#10 0x00690fad in checkPackageDeps (ts=0x94d7a18, pkgNEVRA=0x9a153b8
"gd-2.0.33-7.fc5.i386", requires=0x94db038, 
    conflicts=0x0, depName=0x0, tscolor=0, adding=1) at depends.c:666
#11 0x00691725 in rpmtsCheck (ts=0x94d7a18) at depends.c:1702
#12 0x006bab25 in rpmInstall (ts=0x94d7a18, ia=0x6f0fc0, fileArgv=0x94c1070) at
rpminstall.c:642
#13 0x0804bcd7 in main (argc=4, argv=0xbfd92ae4) at ./rpmqv.c:790
#14 0x001314ce in __libc_start_main () from /lib/libc.so.6
#15 0x0804a941 in _start ()
(gdb) 

This problem may be related to bug #221714

Comment 1 Kasper Dupont 2007-02-13 08:44:24 UTC
I tried attaching gdb a few more times to see if the stack trace looked the same
all the time. Except from the first line number, I didn't see any other stack
trace. The first line number I saw was always one of the following: 159, 160,
168, 171, and 177.

(I would have tried to install rpm-libs-debuginfo as well, but I cannot figure
out the exact name of the rpm package, and when I try to get a directory
listning from
http://download.fedora.redhat.com/pub/fedora/linux/core/5/i386/debug/ I get a
timeout).

Comment 2 Jeff Johnson 2007-02-13 14:01:20 UTC
This is the spoor of the mmap problem in 2.6.18+ kerenels that leads to inconsistent
Berkeley DB cache.

This command willo remove the inconsistent cache
    rm -f /var/lib/rpm/__db

Comment 3 Kasper Dupont 2007-02-13 19:05:23 UTC
After rebooting I was able to install the package.

Comment 4 Jeff Johnson 2007-02-13 19:23:48 UTC
Rebooting does
    rm -f /var/lib/rpm/__db*
as part of initialization.

Comment 5 Kasper Dupont 2007-02-21 19:46:50 UTC
I also got this problem when trying to remove a package using:
rpm -e ekiga

I then noticed another rpm process started by makewhatis had the same problem:
[root@localhost:pts/5:~] ps -fC rpmq
UID        PID  PPID  C STIME TTY          TIME CMD
root      4217  4204 82 17:19 ?        02:47:13 /usr/lib/rpm/rpmq -q --all
--queryformat %-19{NAME} (rpm) - %{SUMMARY}\r
[root@localhost:pts/5:~] strace -p 4217
Process 4217 attached - interrupt to quit
(That one has used almost three hours of CPU time already).

gdb backtrace of the rpm command:
done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libsetrans.so.0...done.
Loaded symbols for /lib/libsetrans.so.0
0x00399bdb in __memp_fput_rpmdb (dbmfp=0x8657870, pgaddr=0xb7cf9a54,
flags=Variable "flags" is not available.
) at ../db/dist/../mp/mp_fput.c:217
217     ../db/dist/../mp/mp_fput.c: No such file or directory.
        in ../db/dist/../mp/mp_fput.c
(gdb) bt
#0  0x00399bdb in __memp_fput_rpmdb (dbmfp=0x8657870, pgaddr=0xb7cf9a54,
flags=Variable "flags" is not available.
) at ../db/dist/../mp/mp_fput.c:217
#1  0x00317c8a in __ham_next_cpage_rpmdb (dbc=0x8657ad0, pgno=12, dirty=0) at
../db/dist/../hash/hash_page.c:1671
#2  0x0031875a in __ham_item_rpmdb (dbc=0x8657ad0, mode=DB_LOCK_READ,
pgnop=0xbf89e6f0) at ../db/dist/../hash/hash_page.c:132
#3  0x0031898d in __ham_item_next_rpmdb (dbc=0x8657ad0, mode=DB_LOCK_READ,
pgnop=0xbf89e6f0)
    at ../db/dist/../hash/hash_page.c:448
#4  0x0030ee00 in __ham_lookup (dbc=0x8657ad0, key=0x86670ac, sought=Variable
"sought" is not available.
) at ../db/dist/../hash/hash.c:1731
#5  0x0030f75c in __ham_c_get (dbc=0x8657ad0, key=0x86670ac, data=0x86670c4,
flags=28, pgnop=0xbf89e6f0)
    at ../db/dist/../hash/hash.c:485
#6  0x0035a00e in __db_c_get_rpmdb (dbc_arg=0x8657968, key=0x86670ac,
data=0x86670c4, flags=28)
    at ../db/dist/../db/db_cam.c:654
#7  0x00360946 in __db_c_get_pp_rpmdb (dbc=0x8657968, key=0x86670ac,
data=0x86670c4, flags=28)
    at ../db/dist/../db/db_iface.c:1741
#8  0x002f0946 in db3cget (dbi=0x8657510, dbcursor=0x8657968, key=0x86670ac,
data=0x86670c4, flags=28) at db3.c:612
#9  0x002ec33f in rpmdbInitIterator (db=0x8643c20, rpmtag=RPMTAG_REQUIRENAME,
keyp=0x8654460, keylen=0) at rpmdb.h:591
#10 0x0015b564 in rpmtsInitIterator (ts=0x86439e8, rpmtag=RPMTAG_REQUIRENAME,
keyp=0x8654460, keylen=0) at rpmts.c:325
#11 0x0012857a in checkDependentPackages (ts=0x86439e8, dep=0x8654460
"/usr/share/gnome/help/ekiga") at depends.c:784
#12 0x00128a22 in rpmtsCheck (ts=0x86439e8) at depends.c:1778
#13 0x0014f175 in rpmErase (ts=0x86439e8, ia=0x187fc0, argv=0x862d070) at
rpminstall.c:817
#14 0x0804beee in main (argc=3, argv=0xbf89ea44) at ./rpmqv.c:749
#15 0x006e44ce in __libc_start_main () from /lib/libc.so.6
#16 0x0804a941 in _start ()
(gdb) 

gdb backtrace of the rpmq command:
done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libsetrans.so.0...done.
Loaded symbols for /lib/libsetrans.so.0
__memp_fput_rpmdb (dbmfp=0x9f71018, pgaddr=0xb7f494c4, flags=Variable "flags" is
not available.
) at ../db/dist/../mp/mp_fput.c:219
219     ../db/dist/../mp/mp_fput.c: No such file or directory.
        in ../db/dist/../mp/mp_fput.c
(gdb) bt
#0  __memp_fput_rpmdb (dbmfp=0x9f71018, pgaddr=0xb7f494c4, flags=Variable
"flags" is not available.
) at ../db/dist/../mp/mp_fput.c:219
#1  0x00359aec in __db_c_cleanup (dbc=0x9f71158, dbc_n=0x9f72418, failed=0) at
../db/dist/../db/db_cam.c:1485
#2  0x0035a125 in __db_c_get_rpmdb (dbc_arg=0x9f71158, key=0x9f723b4,
data=0x9f723cc, flags=3086259396)
    at ../db/dist/../db/db_cam.c:808
#3  0x00360946 in __db_c_get_pp_rpmdb (dbc=0x9f71158, key=0x9f723b4,
data=0x9f723cc, flags=18)
    at ../db/dist/../db/db_iface.c:1741
#4  0x002f0946 in db3cget (dbi=0x9f70770, dbcursor=0x9f71158, key=0x9f723b4,
data=0x9f723cc, flags=18) at db3.c:612
#5  0x002eaf73 in rpmdbNextIterator (mi=0x9f72398) at rpmdb.h:591
#6  0x006b731f in rpmgiNext (gi=0x9f705c8) at rpmgi.c:504
#7  0x006a8a2b in rpmgiShowMatches (qva=0x713680, ts=0x9f70390) at query.c:372
#8  0x006a9032 in rpmQueryVerify (qva=0x713680, ts=0x9f70390, arg=0x0) at
query.c:448
#9  0x006a9e9e in rpmcliArgIter (ts=0x9f70390, qva=0x713680, argv=0x0) at
query.c:728
#10 0x006aa002 in rpmcliQuery (ts=0x9f70390, qva=0x713680, argv=0x0) at query.c:807
#11 0x08049afc in main (argc=5, argv=0xbf8fc144) at ./rpmqv.c:804
#12 0x001314ce in __libc_start_main () from /lib/libc.so.6
#13 0x08049251 in _start ()
(gdb) 

What other information is needed to find the cause of this bug?

Comment 6 Kasper Dupont 2007-02-22 07:41:21 UTC
Now I saw this symptom again. The backtrace looks different this time:

done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libsetrans.so.0...done.
Loaded symbols for /lib/libsetrans.so.0
__memp_fput_rpmdb (dbmfp=0x991fde8, pgaddr=0xb7cb138c, flags=Variable "flags" is
not available.
) at ../db/dist/../mp/mp_fput.c:216
216     ../db/dist/../mp/mp_fput.c: No such file or directory.
        in ../db/dist/../mp/mp_fput.c
(gdb) bt
#0  __memp_fput_rpmdb (dbmfp=0x991fde8, pgaddr=0xb7cb138c, flags=Variable
"flags" is not available.
) at ../db/dist/../mp/mp_fput.c:216
#1  0x003678fb in __db_goff_rpmdb (dbp=0x991fad0, dbt=0x9f72e5c, tlen=677416,
pgno=11655, bpp=0x9923a7c, bpsz=0x9923a84)
    at ../db/dist/../db/db_overflow.c:166
#2  0x0036f15d in __db_ret_rpmdb (dbp=0x991fad0, h=0xb7cb138c, indx=179,
dbt=0x9f72e5c, memp=0x9923a7c, memsize=0x9923a84)
    at ../db/dist/../db/db_ret.c:50
#3  0x0035a48d in __db_c_get_rpmdb (dbc_arg=0x9923a30, key=0x9f72e44,
data=0x9f72e5c, flags=Variable "flags" is not available.
) at ../db/dist/../db/db_cam.c:778
#4  0x00360946 in __db_c_get_pp_rpmdb (dbc=0x9923a30, key=0x9f72e44,
data=0x9f72e5c, flags=28)
    at ../db/dist/../db/db_iface.c:1741
#5  0x002f0946 in db3cget (dbi=0x991f568, dbcursor=0x9923a30, key=0x9f72e44,
data=0x9f72e5c, flags=28) at db3.c:612
#6  0x002eb66d in rpmdbNextIterator (mi=0x9f72e28) at rpmdb.h:591
#7  0x00691f50 in rpmtsAddInstallElement (ts=0x991da10, h=0x991ea40,
key=0x9e59ec8, upgrade=Variable "upgrade" is not available.
) at depends.c:298
#8  0x006ba536 in rpmInstall (ts=0x991da10, ia=0x6f0fc0, fileArgv=0x9907070) at
rpminstall.c:568
#9  0x0804bcd7 in main (argc=3, argv=0xbfe3eb04) at ./rpmqv.c:790
#10 0x001314ce in __libc_start_main () from /lib/libc.so.6
#11 0x0804a941 in _start ()
(gdb) 

I also tried using ltrace, to no avail:

ltrace -p 4151
--- SIGSTOP (Stopped (signal)) ---
--- SIGSTOP (Stopped (signal)) ---


Comment 7 Paul Nasrat 2007-03-13 11:05:52 UTC
If you update to the latest kernel in updates does the problem go away?

Comment 8 Panu Matilainen 2007-07-17 12:58:40 UTC

*** This bug has been marked as a duplicate of 213963 ***


Note You need to log in before you can comment on or make changes to this bug.