Bug 878913 - nscd is segfaulting within libnss_db.so
Summary: nscd is segfaulting within libnss_db.so
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: glibc
Version: 7.0
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Carlos O'Donell
QA Contact: Arjun Shankar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-21 14:23 UTC by Miroslav Franc
Modified: 2016-11-24 12:04 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 977868 (view as bug list)
Environment:
Last Closed: 2014-06-13 09:35:48 UTC
Target Upstream Version:


Attachments (Terms of Use)
Get a prime larger than 3 (754 bytes, patch)
2012-11-27 15:32 UTC, Siddhesh Poyarekar
no flags Details | Diff

Description Miroslav Franc 2012-11-21 14:23:16 UTC
Description of problem:
nscd is segfaulting within libnss_db.so


Version-Release number of selected component (if applicable):
# rpm -q nscd glibc
nscd-2.16-22.el7.x86_64
glibc-2.16-22.el7.x86_64


How reproducible:
all the time


Steps to Reproduce:
1. yum install nscd
2. cd /var/db && make
3. restorecon -R /var/db
4. edit /etc/nsswitch.conf to contain
passwd:     db files 
shadow:     db files 
group:      db files 
5. service nscd start
   
  
Actual results:
[101375.444229] nscd[458]: segfault at 7f53a4c7d95c ip 00007f539c9e9d4f sp 00007fff29b38a90 error 4 in libnss_db-2.16.so[7f539c9e5000+7000]


Expected results:
nscd is up and running

Comment 1 Siddhesh Poyarekar 2012-11-27 14:24:48 UTC
It looks like the hashtable size calculation goes nuts when the number of entries in the database is exactly 1.  I'm testing a patch.

Comment 2 Siddhesh Poyarekar 2012-11-27 15:32:34 UTC
Created attachment 652825 [details]
Get a prime larger than 3

Potential fix.

Comment 3 Siddhesh Poyarekar 2012-11-28 01:20:16 UTC
This is what finally went upstream and needs to be backported:

http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=0817d63dd1f8e165f8ef6590bf4feddf06705381

Comment 5 Jeff Law 2012-12-10 16:46:14 UTC
Miroslav, Patsy & I are having trouble reproducing this.  If I had to hazard a guess it depends on the exact entries in the password/group files when the database is created and nscd gets started.  Can you please pass along those files so that Patsy can confirm the bug is present in nscd-2.16-22.el7.x86_64 and is fixed after applying Siddhesh's patch.

Thanks,
jeff

Comment 6 Siddhesh Poyarekar 2012-12-11 02:14:34 UTC
/etc/group should have exactly one entry of the form:

mail:x:12:postfix

i.e. exactly one entry where a user is listed in a group entry.  A default rhel-7 base installation should have this, unless you're installing qemu or *not* installing postfix (resulting in 0 entries of the above type) - not sure if the latter is possible though.

Comment 7 Miroslav Franc 2012-12-11 09:46:14 UTC
(In reply to comment #5)
As Siddhesh wrote, just pick default installation of RHEL7 in beaker.  But I already tried that (on ppc64), the patch seems to fix the issue.  Even our nss sanity test which caught the issue is passing with the patch applied.  In next months we will focus more on RHEL7 testing and I'll report anything broken.

Comment 13 Ludek Smid 2014-06-13 09:35:48 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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