Bug 112489

Summary: rpm -qf segfaults with relative path
Product: [Fedora] Fedora Reporter: Kasper Dupont <bugzilla>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED DUPLICATE QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 1   
Target Milestone: ---   
Target Release: ---   
Hardware: i586   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-21 19:00:29 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 Kasper Dupont 2003-12-21 00:17:44 UTC
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 13:36:09 UTC
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 19:24:58 UTC
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>

  Electric Fence 2.2.0 Copyright (C) 1987-1999 Bruce Perens
<bruce>
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-22 02:17:25 UTC
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 07:59:41 UTC
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 19:00:29 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.