Bug 184362 - Memory leak in glibc NIS+ resolver when doing repetitive getpwent calls
Memory leak in glibc NIS+ resolver when doing repetitive getpwent calls
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: glibc (Show other bugs)
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
Blocks: RHEL3U8CanFix
  Show dependency treegraph
Reported: 2006-03-08 03:17 EST by Bastien Nocera
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version: RHBA-2006-0453
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-07-20 10:28:37 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Bastien Nocera 2006-03-08 03:17:01 EST
+++ This bug was initially created as a clone of Bug #174847 +++

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10)
Gecko/20050716 Firefox/1.0.6

Description of problem:
We at VMware, recently came across an issue where our application which uses
glibc API calls (getpwent,getgrent,getpwname,getgrname) showed symptoms of
memory leak. Our team isolated the issue to happen only when the host is
configured to authenticate against a NIS+ server. Our application does a large
number of the above mentioned API calls to get the entire user and group list
for internal use in the application. The configuration where the issue is seen
is when the NIS+ server is configured with 8000 or more users and similar number
of groups. The memory leak is not seen if the local user/group list is
configured similar to the NIS+ server with 8000+ entries. The memory leak soon
(a couple of hours) leads to an out of memory condition which causes the process
to crash and hence our application. For ease of use and test purposes, we have
built a simple utility which is a stripped-down code version of what is
implemented in the application for gathering the user/group data. Similar memory
leak symptoms can be seen with this simple utility as well. I am attaching the
source code of the simple utility.
The hosts were this application has been tested are
1) VMware ESX Server 2.5.1 using GLIBC version 2.2.4-32, version  2.2.4-32.20
2) RHEL Workstation 3.0 U4
3) RHEL Advanced Server 4.0 U2

And we could observe the memory leak in all the cases.

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

How reproducible:

Steps to Reproduce:
1) Configure the NIS+ server with 8000+ users and groups
2) Configure a Linux Host to authenticate against the NIS+ server. [Make the
host a NIS+ client and configure nsswitch.conf to use NIS+]
3) Compile the source code of the simple utility, attached with this email using
gcc [ gcc -o nisMem NISMemoryChecking.c]
4) Open two terminal sessions.
    a) In one terminal session, run the simple utility as
        ./nisMem 0 2
              0 - The first parameter is the maximum loop count [One full
iteration of gathering user/group list]
              2 - The second parameter is the sleep interval between two
consecutive loops
    b) In the other terminal, run top | grep nis.
5) You will soon notice that the memory utilization of the program keeps
constantly rising and never goes down until the application is killed with "^C"
or is terminated through other mechanisms.

Actual Results:  we could observe the memory leak.

Additional info:
Comment 3 Jakub Jelinek 2006-03-14 14:43:48 EST
contains a so far only very lightly tested backport of the NIS+ fixes to RHEL3
Comment 12 Bob Johnson 2006-04-11 12:26:30 EDT
This issue is on Red Hat Engineering's list of planned work items 
for the upcoming Red Hat Enterprise Linux 3.8 release.  Engineering 
resources have been assigned and barring unforeseen circumstances, Red 
Hat intends to include this item in the 3.8 release.
Comment 21 Red Hat Bugzilla 2006-07-20 10:28:37 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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