Menu

#2219 file descriptor leak w/ /proc/partitions read in diskio.c

closed
agent (1105)
5
2012-11-08
2011-01-05
Kevin Mowry
No

Found running 2.4.36 kernel.

In the getstats functions of diskio.c there is a read of /proc/partitions and if the relevant statistics info isn't found an error message is written out and the function returns without closing the file pointer to /proc/partitions. After ~90 minutes, the snmpd daemon seg faults when it runs out of space to open more files.

847             if \(rc \!= 15\) \{
848                snmp\_log\(LOG\_ERR, "diskio.c: cannot find statistics in /proc/partitions\n"\);
849                fclose\(parts\);
850                return 1;
851             \}

Line 849 is what I added to close the file pointer before returning from the function.

Discussion

  • Kevin Mowry

    Kevin Mowry - 2011-01-05

    Updated diskio.c file.

     
  • Thomas Anders

    Thomas Anders - 2011-01-30

    Thanks for the bug report!
    We've fixed the problem in the 5.3.x, 5.4.x, 5.5.x and
    5.6.x code branches and the main development tree,
    so it should be fixed in future releases of the
    Net-SNMP package.

     
  • Thomas Anders

    Thomas Anders - 2011-01-30

    SVN Rev. 19899

     

Log in to post a comment.

MongoDB Logo MongoDB