Bug 219461 - rpm segfaults with different nsswitch.conf config
Summary: rpm segfaults with different nsswitch.conf config
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: rpm
Version: 2.1
Hardware: i386
OS: Linux
high
high
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-12-13 10:32 UTC by Olivier de Liocourt
Modified: 2007-11-30 22:06 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-10-19 19:19:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Olivier de Liocourt 2006-12-13 10:32:52 UTC
rpm segfaults installing some packages. rpm release up to date

Trace:
[root@cgatstws21 rpm-4.0.4]# gdb ./rpm
GNU gdb Red Hat Linux (5.3.90-0.20030710.41.2.1rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...Using host libthread_db library
"/lib/libthread_db.so.1".

(gdb) break getpwnam
Breakpoint 1 at 0x8142656: file ../nss/getXXbyYY.c, line 104.
(gdb) run -U /tmp/autosys-4.5-build86-i386.rpm 
Starting program: /tmp/rpm-4.0.4/rpm -U /tmp/autosys-4.5-build86-i386.rpm

Breakpoint 1, getpwnam (name=0x81b1297 "root") at ../nss/getXXbyYY.c:104
104     ../nss/getXXbyYY.c: No such file or directory.
        in ../nss/getXXbyYY.c
(gdb) continue
Continuing.

Breakpoint 1, getpwnam (name=0x827d3e8 "auto_D01") at ../nss/getXXbyYY.c:104
104     in ../nss/getXXbyYY.c
(gdb) n
94      in ../nss/getXXbyYY.c
(gdb) where
#0  getpwnam (name=0x827d3e8 "auto_D01") at ../nss/getXXbyYY.c:94
#1  0x081000bd in unameToUid (thisUname=0x827d3e8 "auto_D01", uid=0xbffebe90) at
ugid.c:42
#2  0x080654d5 in psmStage (psm=0xbffec520, stage=PSM_PROCESS) at psm.c:1615
#3  0x08065f16 in psmStage (psm=0xbffec520, stage=PSM_PKGINSTALL) at psm.c:1884
#4  0x08075474 in rpmRunTransactions (ts=0x823e2d0, notify=0x8069978
<rpmShowProgress>, notifyData=0xa0, okProbs=0x0, 
    newProbs=0xbffec634, transFlags=RPMTRANS_FLAG_NONE,
ignoreSet=RPMPROB_FILTER_NONE) at transaction.c:2044
#5  0x0806aa8f in rpmInstall (rootdir=0x81c5797 "/", fileArgv=0x82194d0,
transFlags=RPMTRANS_FLAG_NONE, interfaceFlags=160, 
    probFilter=RPMPROB_FILTER_NONE, relocations=0x0) at rpminstall.c:534
#6  0x08049820 in main (argc=3, argv=0xbffec924) at rpmqv.c:1070
(gdb) n
104     in ../nss/getXXbyYY.c
(gdb) n
106     in ../nss/getXXbyYY.c
(gdb) n
131     in ../nss/getXXbyYY.c
(gdb) 

Program received signal SIGSEGV, Segmentation fault.
0x402cc50a in ?? ()


/etc/nsswitch.conf configured:
passwd compat

The bug does not trigger if we put:
passwd files nis

Comment 1 Paul Nasrat 2006-12-13 12:21:20 UTC
Does running nscd avoid SEGV?

Comment 2 Olivier de Liocourt 2006-12-13 13:28:35 UTC
yes, it is.

Could explain me the problem please ?

Comment 3 Paul Nasrat 2006-12-13 13:41:20 UTC
Your answer is unclear - do you mean:

1) you were already running nscd when you experienced the segfault
2) running nscd with this nsswitch.conf setup does not seg fault
3) running nscd with this nsswitch.conf does setup



Comment 4 Olivier de Liocourt 2006-12-13 13:52:15 UTC
1) no
2) yes
3) no



Comment 5 Paul Nasrat 2006-12-13 15:35:02 UTC
OK in which case this is a known issue (it also affects nis/ldap setups when the
server is unreachable) with the rpm on 2.1.  Workaround run nscd.

I'm pretty sure it's due to the fact /bin/rpm is static and you're dynamically
loading compat NSS module which doesn't work properly.  See also:

http://www.redhat.com/archives/rpm-list/2002-October/msg00046.html

2.1 is in maintenance mode at the moment and I don't think this classifies the
criteria for a bug fix.  Please also test RHEL 3 U8, RHEL 4 U4, RHEL 5.0 beta 2
latest snapshot.  I'm pretty sure it's fixed in later releases.

Comment 7 Jeff Johnson 2006-12-13 17:58:37 UTC
The issue is with LDAP passwords, the segfault is due to an
obscure rpm -> library -> library linking issue that "works"
with dynamic linking, but not with static linking.

Running nscd changes the lookup paths within
glibc to avoid the problem.

I doubt this flaw will ever be resolved. The choices are
    1) Run nscd
    2) Don't use LDAP passwords.
    3) Rebuild rpm with dynamic, not static, linking.

Comment 9 RHEL Program Management 2007-10-19 19:19:48 UTC
This bug is filed against RHEL2.1, which is in maintenance phase.
During the maintenance phase, only security errata and select mission
critical bug fixes will be released for enterprise products.  Since
this bug does not meet that criteria, it is now being closed.

For more information of the RHEL errata support policy, please visit:
http://www.redhat.com/security/updates/errata/

If you feel this bug is indeed mission critical, please contact your
support representative.  You may be asked to provide detailed
information on how this bug is affecting you.


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