Bug 561875 - Leak of FD in rmon-mib
Leak of FD in rmon-mib
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: net-snmp (Show other bugs)
5.4
All Linux
urgent Severity urgent
: rc
: ---
Assigned To: Jan Safranek
BaseOS QE Security Team
: Patch, ZStream
: 572206 (view as bug list)
Depends On:
Blocks: 562108 585202 651806 651807
  Show dependency treegraph
 
Reported: 2010-02-04 10:39 EST by Olivier Fourdan
Modified: 2013-03-03 21:48 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 562108 (view as bug list)
Environment:
Last Closed: 2011-07-21 05:08:25 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Proposed patch (3.55 KB, patch)
2010-02-04 10:39 EST, Olivier Fourdan
no flags Details | Diff

  None (edit)
Description Olivier Fourdan 2010-02-04 10:39:41 EST
Created attachment 388816 [details]
Proposed patch

Description of problem:

In etherStatsTable_container_load() and dot3StatsTable_container_load(), the descriptor by socket() is not closed.

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

net-snmp-5.3.2.2-7.el5

How reproducible:

Always

Steps to Reproduce:
1. Configure /etc/snmp/snmpd.confview all MIBs.

    ------------------------------------
    view    systemview    included   .1
    ------------------------------------

2. Restart snmpd

3. Run snmpwalk to get MIB information.

    # snmpwalk -v 1 -c public localhost > /dev/null

4. Count the number of entries related to snmpd in lsof

    # lsof | grep snmpd | wc -l

5. Redo step 3. and 4. a few times
  
Actual results:

The number of files open by snmpd increases

Expected results:

The number of files open by snmpd remains stable

Additional info:

It seems etherStatsTable_container_load() and dot3StatsTable_container_load() do not close the descriptor returned by socket.

Closing the fd in etherStatsTable_container_load() and dot3StatsTable_container_load() seems to help limiting the number of descriptors used by snpmd over each snmpwalk run.
Comment 1 Jan Safranek 2010-02-05 05:56:37 EST
I've fixed it upstream, SVN rev. 18101
Comment 2 Jan Safranek 2010-03-11 09:16:46 EST
*** Bug 572206 has been marked as a duplicate of this bug. ***
Comment 5 Miroslav Vadkerti 2010-04-23 05:01:40 EDT
Putting QA_ACK, repro steps look clear. Adding RHTS keyword.
Comment 9 Robin Bowes 2010-05-31 17:03:55 EDT
I'm seeing something similar with net-snmp-5.4.2.1 that I've built from Fedora sources. However, neither of the sources files patched in this ticket are present in the 5.4.2.1 tarball.

Any ideas how to debug further?

R.
Comment 10 Robin Bowes 2010-06-12 08:21:01 EDT
What is particularly strange in my case is that I have > 100 machines, all configured identically (deployed with cobbler & maintained with puppet) and I'm only seeing the problem on this one machine.

It runs fine for some time, then snmp collection stops working with many lines like this in the log:

2010-06-12_07:55:55.87796 couldn't create socket

2010-06-12_08:00:55.87873 could not open /proc/net/if_inet6

2010-06-12_08:00:55.87884 error on subcontainer 'interface container' insert (-1)

Before finally seeing:

2010-06-12_08:05:55.88059 could not create socket
2010-06-12_08:05:55.88242 could not create socket
2010-06-12_08:05:58.14448 /proc/stat: Too many open files
2010-06-12_08:06:03.14449 /proc/stat: Too many open files
2010-06-12_08:06:08.14449 /proc/stat: Too many open files
2010-06-12_08:06:10.88056 cannot open /proc/net/dev ...
2010-06-12_08:06:13.14556 /proc/stat: Too many open files
2010-06-12_08:06:18.14560 /proc/stat: Too many open files
2010-06-12_08:06:23.14656 /proc/stat: Too many open files
2010-06-12_08:06:25.78956 cannot open /proc/net/snmp ...
2010-06-12_08:06:25.78959 cannot open /proc/net/snmp6 ...
2010-06-12_08:06:25.88056 cannot open /proc/net/dev ...

etc.
Comment 17 errata-xmlrpc 2011-07-21 05:08:25 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 therefore 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.

http://rhn.redhat.com/errata/RHBA-2011-1076.html
Comment 18 errata-xmlrpc 2011-07-21 08:20:50 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 therefore 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.

http://rhn.redhat.com/errata/RHBA-2011-1076.html

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