Bug 561875 - Leak of FD in rmon-mib
Summary: Leak of FD in rmon-mib
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: net-snmp
Version: 5.4
Hardware: All
OS: Linux
urgent
urgent
Target Milestone: rc
: ---
Assignee: Jan Safranek
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
: 572206 (view as bug list)
Depends On:
Blocks: 562108 585202 651806 651807
TreeView+ depends on / blocked
 
Reported: 2010-02-04 15:39 UTC by Olivier Fourdan
Modified: 2019-10-10 09:00 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 562108 (view as bug list)
Environment:
Last Closed: 2011-07-21 09:08:25 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1076 0 normal SHIPPED_LIVE net-snmp bug fix and enhancement update 2011-07-21 09:07:58 UTC

Description Olivier Fourdan 2010-02-04 15:39:41 UTC
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 10:56:37 UTC
I've fixed it upstream, SVN rev. 18101

Comment 2 Jan Safranek 2010-03-11 14:16:46 UTC
*** Bug 572206 has been marked as a duplicate of this bug. ***

Comment 5 Miroslav Vadkerti 2010-04-23 09:01:40 UTC
Putting QA_ACK, repro steps look clear. Adding RHTS keyword.

Comment 9 Robin Bowes 2010-05-31 21:03:55 UTC
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 12:21:01 UTC
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 09:08:25 UTC
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 12:20:50 UTC
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.