Bug 84927 - rpm-4.1 segfaults on -U or -i
rpm-4.1 segfaults on -U or -i
Status: CLOSED WORKSFORME
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
8.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-02-23 18:07 EST by Sean Fay
Modified: 2007-04-18 12:51 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-03-11 11:06:36 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
gdb backtrace (504 bytes, text/plain)
2003-03-03 10:25 EST, Sean Fay
no flags Details
strace (172.66 KB, application/x-gunzip)
2003-03-03 10:31 EST, Sean Fay
no flags Details
backtrace w/nscd running (736 bytes, text/plain)
2003-03-10 11:58 EST, Sean Fay
no flags Details
strace w/nscd running (172.25 KB, application/x-gunzip)
2003-03-10 12:01 EST, Sean Fay
no flags Details
strace with -vv (174.89 KB, application/x-gunzip)
2003-03-10 23:09 EST, Sean Fay
no flags Details

  None (edit)
Description Sean Fay 2003-02-23 18:07:27 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030210

Description of problem:
rpm segfaults when i try to install any package.  removing lockfiles and running
--rebuilddb doesn't help.  there are stale lockfiles left _every_ time it runs,
even if it doesn't segfault (ie after --rebuilddb).

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


How reproducible:
Always

Steps to Reproduce:
1. rpm -Uvh any-package.rpm
    

Actual Results:  warning: samba-2.2.7-4.i386.rpm: V3 DSA signature: NOKEY, key
ID 897da07a
Preparing...                ########################################### [100%]
Segmentation fault

Additional info:
Comment 1 Jeff Johnson 2003-02-24 18:20:40 EST
Are you using LDAP passwords? If so, make sure that nscd
is running to avoid a segfault that affects statically
linked binaries like /bin/rpm.

Otherwise, please append output from rpm -Uvv ... here.
Comment 2 Sean Fay 2003-02-24 23:02:49 EST
I am not running LDAP, but i started nscd just for the hell of it.  No love there.


[root@organic rpms]# rpm -Uvv samba-*
D: ============== samba-2.2.7-4.i386.rpm
D: Expected size:      2633554 = lead(96)+sigs(344)+pad(0)+data(2633114)
D:   Actual size:      2633554
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/Pubkeys rdonly mode=0x0
warning: samba-2.2.7-4.i386.rpm: V3 DSA signature: NOKEY, key ID 897da07a
D: opening  db index       /var/lib/rpm/Providename rdonly mode=0x0
D:  read h#     331 Header V3 DSA signature: NOKEY, key ID db42a60e
D:      added binary package [0]
D: ============== samba-client-2.2.7-4.i386.rpm
D: Expected size:      2422740 = lead(96)+sigs(344)+pad(0)+data(2422300)
D:   Actual size:      2422740
D: samba-client-2.2.7-4.i386.rpm: V3 DSA signature: NOKEY, key ID 897da07a
D:  read h#     190 Header V3 DSA signature: NOKEY, key ID db42a60e
D:      added binary package [1]
D: ============== samba-common-2.2.7-4.i386.rpm
D: Expected size:      2459463 = lead(96)+sigs(344)+pad(0)+data(2459023)
D:   Actual size:      2459463
D: samba-common-2.2.7-4.i386.rpm: V3 DSA signature: NOKEY, key ID 897da07a
D:  read h#     870 Header V3 DSA signature: NOKEY, key ID db42a60e
D:      added binary package [2]
D: found 0 source and 3 binary packages
D: ========== +++ samba-2.2.7-4
D: opening  db index       /var/lib/rpm/Depends create mode=0x0
D:  read h#     406 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: pam >= 0.64                                   YES (db provides)
D: opening  db index       /var/lib/rpm/Basenames rdonly mode=0x0
D:  read h#     406 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: /etc/pam.d/system-auth                        YES (db files)
D:  Requires: samba-common = 2.2.7                          YES (added provide)
D:  read h#     458 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: logrotate >= 3.4                              YES (db provides)
D:  read h#     234 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: initscripts >= 5.54-1                         YES (db provides)
D:  read h#     427 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: /sbin/chkconfig                               YES (db files)
D:  read h#     421 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: /bin/mktemp                                   YES (db files)
D:  read h#     616 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: /usr/bin/killall                              YES (db files)
D:  read h#     125 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: fileutils                                     YES (db provides)
D:  read h#     843 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: sed                                           YES (db provides)
D:  read h#     427 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: /etc/init.d                                   YES (db files)
D:  read h#     233 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: /bin/sh                                       YES (db files)
D:  Requires: /bin/sh                                       YES (cached)
D:  Requires: /bin/sh                                       YES (cached)
D:  Requires: /bin/sh                                       YES (cached)
D:  Requires: rpmlib(PayloadFilesHavePrefix) <= 4.0-1       YES (rpmlib provides)
D:  Requires: rpmlib(CompressedFileNames) <= 3.0.4-1        YES (rpmlib provides)
D:  Requires: rpmlib(VersionedDependencies) <= 3.0.3-1      YES (rpmlib provides)
D:  read h#     254 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: /bin/csh                                      YES (db files)
D:  Requires: /bin/sh                                       YES (cached)
D:  read h#     298 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: libacl.so.1                                   YES (db provides)
D:  read h#     492 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: libcrypto.so.2                                YES (db provides)
D:  read h#     225 Header V3 DSA signature: NOKEY, key ID 897da07a
D:  Requires: libc.so.6                                     YES (db provides)
D:  read h#     225 Header V3 DSA signature: NOKEY, key ID 897da07a
D:  Requires: libc.so.6(GLIBC_2.0)                          YES (db provides)
D:  read h#     225 Header V3 DSA signature: NOKEY, key ID 897da07a
D:  Requires: libc.so.6(GLIBC_2.1)                          YES (db provides)
D:  read h#     225 Header V3 DSA signature: NOKEY, key ID 897da07a
D:  Requires: libc.so.6(GLIBC_2.1.1)                        YES (db provides)
D:  read h#     225 Header V3 DSA signature: NOKEY, key ID 897da07a
D:  Requires: libc.so.6(GLIBC_2.1.3)                        YES (db provides)
D:  read h#     225 Header V3 DSA signature: NOKEY, key ID 897da07a
D:  Requires: libc.so.6(GLIBC_2.2)                          YES (db provides)
D:  read h#     225 Header V3 DSA signature: NOKEY, key ID 897da07a
D:  Requires: libc.so.6(GLIBC_2.3)                          YES (db provides)
D:  read h#     738 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: libcups.so.2                                  YES (db provides)
D:  read h#     225 Header V3 DSA signature: NOKEY, key ID 897da07a
D:  Requires: libdl.so.2                                    YES (db provides)
D:  read h#     225 Header V3 DSA signature: NOKEY, key ID 897da07a
D:  Requires: libdl.so.2(GLIBC_2.0)                         YES (db provides)
D:  read h#     225 Header V3 DSA signature: NOKEY, key ID 897da07a
D:  Requires: libdl.so.2(GLIBC_2.1)                         YES (db provides)
D:  read h#     225 Header V3 DSA signature: NOKEY, key ID 897da07a
D:  Requires: libnsl.so.1                                   YES (db provides)
D:  read h#     225 Header V3 DSA signature: NOKEY, key ID 897da07a
D:  Requires: libnsl.so.1(GLIBC_2.0)                        YES (db provides)
D:  read h#     406 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: libpam.so.0                                   YES (db provides)
D:  read h#     478 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: libpopt.so.0                                  YES (db provides)
D:  read h#     492 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: libssl.so.2                                   YES (db provides)
D:  read h#     712 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: perl(Exporter)                                YES (db provides)
D:  Requires: perl(smbldap_conf)                            YES (added provide)
D:  read h#     712 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: perl(strict)                                  YES (db provides)
D:  read h#     712 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: perl(vars)                                    YES (db provides)
D: ========== +++ samba-client-2.2.7-4
D:  Requires: samba-common = 2.2.7                          YES (added provide)
D:  Requires: rpmlib(PayloadFilesHavePrefix) <= 4.0-1       YES (cached)
D:  Requires: rpmlib(CompressedFileNames) <= 3.0.4-1        YES (cached)
D:  Requires: /bin/sh                                       YES (cached)
D:  Requires: libacl.so.1                                   YES (cached)
D:  Requires: libcrypto.so.2                                YES (cached)
D:  Requires: libc.so.6                                     YES (cached)
D:  Requires: libc.so.6(GLIBC_2.0)                          YES (cached)
D:  Requires: libc.so.6(GLIBC_2.1)                          YES (cached)
D:  Requires: libc.so.6(GLIBC_2.2)                          YES (cached)
D:  Requires: libc.so.6(GLIBC_2.3)                          YES (cached)
D:  Requires: libcups.so.2                                  YES (cached)
D:  Requires: libdl.so.2                                    YES (cached)
D:  Requires: libdl.so.2(GLIBC_2.0)                         YES (cached)
D:  Requires: libdl.so.2(GLIBC_2.1)                         YES (cached)
D:  read h#     321 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: libncurses.so.5                               YES (db provides)
D:  Requires: libnsl.so.1                                   YES (cached)
D:  Requires: libnsl.so.1(GLIBC_2.0)                        YES (cached)
D:  Requires: libpam.so.0                                   YES (cached)
D:  Requires: libpopt.so.0                                  YES (cached)
D:  read h#      65 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  Requires: libreadline.so.4                              YES (db provides)
D:  Requires: libssl.so.2                                   YES (cached)
D: ========== +++ samba-common-2.2.7-4
D:  Requires: /bin/sh                                       YES (cached)
D:  Requires: /bin/sh                                       YES (cached)
D:  Requires: rpmlib(PayloadFilesHavePrefix) <= 4.0-1       YES (cached)
D:  Requires: rpmlib(CompressedFileNames) <= 3.0.4-1        YES (cached)
D:  Requires: /bin/sh                                       YES (cached)
D:  Requires: libacl.so.1                                   YES (cached)
D:  Requires: libcrypto.so.2                                YES (cached)
D:  Requires: libc.so.6                                     YES (cached)
D:  Requires: libc.so.6(GLIBC_2.0)                          YES (cached)
D:  Requires: libc.so.6(GLIBC_2.1)                          YES (cached)
D:  Requires: libc.so.6(GLIBC_2.1.1)                        YES (cached)
D:  Requires: libc.so.6(GLIBC_2.1.3)                        YES (cached)
D:  Requires: libc.so.6(GLIBC_2.2)                          YES (cached)
D:  Requires: libc.so.6(GLIBC_2.3)                          YES (cached)
D:  Requires: libcups.so.2                                  YES (cached)
D:  Requires: libdl.so.2                                    YES (cached)
D:  Requires: libdl.so.2(GLIBC_2.0)                         YES (cached)
D:  Requires: libdl.so.2(GLIBC_2.1)                         YES (cached)
D:  Requires: libnsl.so.1                                   YES (cached)
D:  Requires: libnsl.so.1(GLIBC_2.0)                        YES (cached)
D:  Requires: libpam.so.0                                   YES (cached)
D:  Requires: libpopt.so.0                                  YES (cached)
D:  Requires: libssl.so.2                                   YES (cached)
D: ========== --- samba-2.2.7-2
D: opening  db index       /var/lib/rpm/Requirename rdonly mode=0x0
D: ========== --- samba-client-2.2.7-2
D: ========== --- samba-common-2.2.7-2
D: closed   db index       /var/lib/rpm/Depends
D: ========== recording tsort relations
D:  Requires: samba-common = 2.2.7                          YES (added provide)
D: ignore package name relation(s) [0]  libtermcap -> bash
D: ignore package name relation(s) [1]  modutils -> vixie-cron
D: ignore package name relation(s) [2]  ypbind -> yp-tools
D: ignore package name relation(s) [3]  ghostscript-fonts -> ghostscript
D: ignore package name relation(s) [4]  libgnomeprint15 -> gnome-print
D: ignore package name relation(s) [5]  nautilus -> nautilus-mozilla
D: ignore package name relation(s) [6]  tcl -> postgresql-tcl
D: ignore package name relation(s) [7]  arts -> kdelibs-sound
D: ignore package name relation(s) [8]  pango-gtkbeta-devel -> pango-gtkbeta
D: ignore package name relation(s) [9]  XFree86 -> Mesa
D: ignore package name relation(s) [10] compat-glibc -> db2
D: ignore package name relation(s) [11] compat-glibc -> db1
D: ignore package name relation(s) [12] pam -> initscripts
D: ignore package name relation(s) [13] initscripts -> sysklogd
D:  Requires: perl(smbldap_conf)                            YES (added provide)
D:  Requires: samba-common = 2.2.7                          YES (added provide)
D:  Requires: perl(smbldap_conf)                            YES (added provide)
D:  Requires: samba-common = 2.2.7                          YES (added provide)
D:  Requires: samba-common = 2.2.7                          YES (added provide)
D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth)
D:     0    0    4    0    0 +samba-common-2.2.7-4
D:     1    1    1    0    1   +samba-2.2.7-4
D: ========== successors only (presentation order)
D:     2    2    0    0    2     -samba-2.2.7-2
D:     3    1    0    0    1   +samba-client-2.2.7-4
D:     4    1    0    0    1   -samba-client-2.2.7-2
D:     5    0    0    1    0 -samba-common-2.2.7-2
D: installing binary packages
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/Basenames
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: getting list of mounted filesystems
D: sanity checking 6 elments
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#     870 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  read h#     870 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  read h#     331 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  read h#     331 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  read h#     190 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  read h#     190 Header V3 DSA signature: NOKEY, key ID db42a60e
D: computing 590 file fingerprints
Preparing packages for installation...
D: computing file dispositions
D: opening  db index       /var/lib/rpm/Basenames create mode=0x42
D:  read h#     870 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  read h#     331 Header V3 DSA signature: NOKEY, key ID db42a60e
D:  read h#     190 Header V3 DSA signature: NOKEY, key ID db42a60e
D: ========== +++ samba-common-2.2.7-4
D: Expected size:      2459463 = lead(96)+sigs(344)+pad(0)+data(2459023)
D:   Actual size:      2459463
D:   install: samba-common-2.2.7-4 has 63 files, test = 0
D:  read h#     870 Header V3 DSA signature: NOKEY, key ID db42a60e
Segmentation fault
Comment 3 Jeff Johnson 2003-02-25 17:43:30 EST
What happens if you do
    rpm --import /usr/share/doc/rpm-4.1/RPM-GPG-KEY
and then do
    rpm --rebuilddb -vv
I predict that the damaged header will be detected and dropped.
Comment 4 Sean Fay 2003-02-25 18:11:51 EST
no luck with this.
Comment 5 Jeff Johnson 2003-02-25 18:20:36 EST
No luck with --import or same problem?

If same problem, give me a pointer to a tarball
    cd /var/lib
    tar czvf /tmp/rpmdb-84927.tar.gz rpm
and I'll take a look.
Comment 6 Sean Fay 2003-02-25 19:29:57 EST
the --import seemed to succeed, although it left stale locks (as rpm does every
time) and the segfault still happens.
Comment 7 Jeff Johnson 2003-02-26 10:23:59 EST
Your rpmdb looks fine, all headers verify when pubkeys
are imported, so i'm looking for a different cause.
(most segfaults in rpm are caused by bad data).

Can you attach an strace and a backtrace from gdb? Thanks..
Comment 8 Sean Fay 2003-03-03 10:25:51 EST
Created attachment 90450 [details]
gdb backtrace
Comment 9 Sean Fay 2003-03-03 10:31:34 EST
Created attachment 90451 [details]
strace
Comment 10 Sean Fay 2003-03-10 01:56:19 EST
Is there some way of either rebuilding the database by hand or manually
installing a new version of the rpm tool so that I can get it working?  My
system is a state of total disaray... KDE has been half upgraded and no longer
works. 
Comment 11 Jeff Johnson 2003-03-10 11:37:03 EST
This idicates that you are not running nscd. Can you start
nscd by doing (as root)
    /sbin/service nscd restart

12829 socket(PF_UNIX, SOCK_STREAM, 0)   = 7
12829 connect(7, {sin_family=AF_UNIX, path="/var/run/.nscd_socket"}, 110) = -1
ENOENT (No such file or directory)
12829 close(7)                          = 0

Yes you can reinstall rpm manually using rpm2cpio. If all the rpm
packages (don't forget popt) are in /var/tmp, the following commands will
reinstall rpm:

    mkdir /var/tmp/xxx
    cd /var/tmp/xxx
    for pkg in ../*.rpm
    do
        rpm2cpio $pkg | cpio -dim
    done
    find . -type d -exec chmod 755 {} \;
    tar cf - . | (cd /; tar xvf -)

The database can be checked using db_verify from the db4-utils
package, and can be rebuilt using db_dump/db_load. Details at
http://www.rpm.org somewhere.

Comment 12 Sean Fay 2003-03-10 11:58:59 EST
Created attachment 90541 [details]
backtrace w/nscd running
Comment 13 Sean Fay 2003-03-10 12:01:25 EST
Created attachment 90542 [details]
strace w/nscd running
Comment 14 Jeff Johnson 2003-03-10 12:29:42 EST
OK, that strace shows a functioning root lookup using nscd.

Now I need to understand the following:

3702  chroot(".")                       = 0
3702  chdir("/home/sean/download/rpms") = 0
3702  ioctl(1, SNDCTL_TMR_TIMEBASE, {B38400 opost isig icanon echo ...}) = 0
3702  ioctl(1, SNDCTL_TMR_TIMEBASE, {B38400 opost isig icanon echo ...}) = 0
3702  ioctl(1, SNDCTL_TMR_TIMEBASE, {B38400 opost isig icanon echo ...}) = 0
3702  ioctl(1, SNDCTL_TMR_TIMEBASE, {B38400 opost isig icanon echo ...}) = 0
3702  ioctl(1, SNDCTL_TMR_TIMEBASE, {B38400 opost isig icanon echo ...}) = 0
3702  ioctl(1, SNDCTL_TMR_TIMEBASE, {B38400 opost isig icanon echo ...}) = 0
3702  ioctl(1, SNDCTL_TMR_TIMEBASE, {B38400 opost isig icanon echo ...}) = 0
3702  ioctl(1, SNDCTL_TMR_TIMEBASE, {B38400 opost isig icanon echo ...}) = 0
3702  write(1, "################################"..., 700) = 700
3702  ioctl(1, SNDCTL_TMR_TIMEBASE, {B38400 opost isig icanon echo ...}) = 0
3702  write(1, "################################"..., 51) = 51
3702  rt_sigprocmask(SIG_BLOCK, ~[], [RTMIN], 8) = 0
3702  rt_sigprocmask(SIG_SETMASK, [RTMIN], NULL, 8) = 0
3702  open("samba-common-2.2.7-4.i386.rpm", O_RDONLY) = 6
3702  fcntl64(6, F_SETFD, FD_CLOEXEC)   = 0

First, is /home/sean/download/rpms on NFS, possibly with root squashing?

Can you try copying the file to a local disk and install from there?

Also, can you run with -vv options so that I can guess better what is happening?

Thanks
Comment 15 Sean Fay 2003-03-10 23:09:45 EST
Created attachment 90547 [details]
strace with -vv
Comment 16 Sean Fay 2003-03-10 23:10:58 EST
the files are on a local disk.  i tried copying them to /tmp, but this made no
difference.
Comment 17 Sean Fay 2003-03-10 23:43:07 EST
upgrading to rpm 4.2 seems to have fixed the problem.
Comment 18 Jeff Johnson 2003-03-11 11:06:36 EST
Good, at least something worked. Dunno what the original
problem is/was, glad to hear that rpm-4.2 works for you.
Comment 19 Jeff Spirko 2003-04-08 17:21:27 EDT
I think this is the same as Bug #85479 and Bug #86197.  It happened to me when
upgrading to glibc-2.3.2 without upgrading to rpm-4.2 and nscd-2.3.2.  Pretty
much the same solution: manually upgrade nscd and rpm, then officially upgrade
nscd and rpm to get the database up to speed.

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