Red Hat Bugzilla – Bug 561875
Leak of FD in rmon-mib
Last modified: 2013-03-03 21:48:49 EST
Created attachment 388816 [details]
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):
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
The number of files open by snmpd increases
The number of files open by snmpd remains stable
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.
I've fixed it upstream, SVN rev. 18101
*** Bug 572206 has been marked as a duplicate of this bug. ***
Putting QA_ACK, repro steps look clear. Adding RHTS keyword.
I'm seeing something similar with net-snmp-22.214.171.124 that I've built from Fedora sources. However, neither of the sources files patched in this ticket are present in the 126.96.36.199 tarball.
Any ideas how to debug further?
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 ...
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.