Bug 112489 - rpm -qf segfaults with relative path
rpm -qf segfaults with relative path
Status: CLOSED DUPLICATE of bug 107835
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
1
i586 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-12-20 19:17 EST by Kasper Dupont
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-02-21 14:00:29 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)

  None (edit)
Description Kasper Dupont 2003-12-20 19:17:44 EST
Description of problem:
If relative path to /etc/skel/.bash_profile is given to rpm -qf a
segfault happens (but only if executed by root).

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

How reproducible:
Happens always

Steps to Reproduce:
1. su -
2. cd /etc/skel
3. rpm -qf .bash_profile
  
Actual results:
Segmentation fault (core dumped)

Expected results:
bash-2.05b-31
Comment 1 Jeff Johnson 2003-12-21 08:36:09 EST
Works fine here with rpm-4.2.2.

Please attach rpm -qf -vv output.

You might also try
    rpm -qf --nosignature .bash_profile
Comment 2 Kasper Dupont 2003-12-21 14:24:58 EST
Output from "-qf -vv .bash_profile":
D: unshared posix mutexes found(38), adding DB_PRIVATE, using fcntl lock
D: opening  db environment /var/lib/rpm/Packages create:cdb:mpool:private
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/Basenames rdonly mode=0x0
D: opening  db index       /var/lib/rpm/Pubkeys rdonly mode=0x0
D:  read h#    1459 Header sanity check: OK
D: ========== DSA pubkey id b44269d04f2a6fd2
D:  read h#      33 Header V3 DSA signature: OK, key ID 4f2a6fd2
bash-2.05b-31
D: closed   db index       /var/lib/rpm/Pubkeys
D: closed   db index       /var/lib/rpm/Basenames
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages

output from "rpm -qf --nosignature .bash_profile":
bash-2.05b-31

I found this a litle strange, so I tried with Electric Fence. Now it
generates a segfault even with "-vv", and that happens no matter who
runs the command, so it seems Electric Fence does make it easier to
reproduce the problem. Output from "ef rpm -qf -vv .bash_profile":

  Electric Fence 2.2.0 Copyright (C) 1987-1999 Bruce Perens
<bruce@perens.com>

  Electric Fence 2.2.0 Copyright (C) 1987-1999 Bruce Perens
<bruce@perens.com>
D: unshared posix mutexes found(38), adding DB_PRIVATE, using fcntl lock
D: opening  db environment /var/lib/rpm/Packages create:cdb:mpool:private
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/Basenames rdonly mode=0x0
D: opening  db index       /var/lib/rpm/Pubkeys rdonly mode=0x0
D:  read h#    1459 Header sanity check: OK
D: ========== DSA pubkey id b44269d04f2a6fd2
D:  read h#      33 Header V3 DSA signature: OK, key ID 4f2a6fd2
/usr/bin/ef: line 20:  4408 Segmentation fault      ( export
LD_PRELOAD=libefence.so.0.0; exec $* )
Comment 3 Jeff Johnson 2003-12-21 21:17:25 EST
Try
    rm -f /var/lib/rpm/Pubkeys
    rpm --rebuilddb -vv

If that fixes the problem, then this is probably
a duplicate of #107835, fixed in rpm-4.2.2-0.6.

Does that "fix"?

BTW, you should upgrade to a NPTL aware kernel and
glibc (from RHL 9.0 at least) if you want to use rpm-4.2
or later.
Comment 4 Kasper Dupont 2003-12-22 02:59:41 EST
The suggested rebuild of the database made the symptoms go away. But
running under Electric Fence it still segfaults. I tried the patch for
bug #107835. The last of the three hunks in the patch were already
applied to the rpm version on my system. Applying the first two hunks
from that patch seems to have solved the problem. I mark this bug a
duplicate. BTW Fedora Core already uses an nptl aware
kernel-2.4.22-1.2129.nptl and a more recent glibc than RHL 9.0.


*** This bug has been marked as a duplicate of 107835 ***
Comment 5 Red Hat Bugzilla 2006-02-21 14:00:29 EST
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

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