Bug 162673 - [PATCH] net/rinetd: Fix resource leak
Summary: [PATCH] net/rinetd: Fix resource leak
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Renato Botelho
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-19 01:20 UTC by Michael Gmelin
Modified: 2011-11-19 14:40 UTC (History)
1 user (show)

See Also:


Attachments
rinetd-0.62_4.patch (909 bytes, patch)
2011-11-19 01:20 UTC, Michael Gmelin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Gmelin 2011-11-19 01:20:07 UTC
rinetd fails to close the configuration file (fopen twice, fclose only once) when reading its configuration. Therefore on every configuration reload (through SIGHUP) one file descriptor is lost. In an environment where this is done frequently (e.g. to re-lookup DNS names) the system will run out of file descriptors soon (kern.maxfiles) until rinetd crashes.
(I informed the author through his webpage, but I'm not sure if there'll be a response anytime soon)

Port maintainer (garga@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99

How-To-Repeat: 
Start rinetd, and use fstat to check the number of open file descriptors:
fstat | grep rinetd | wc -l

Give the process a SIGHUP (killall -HUP rinetd) and run check the number of open file descriptors using fstat again. On every SIGHUP the number of file descriptors used is increased by one.
Comment 1 Edwin Groothuis freebsd_committer 2011-11-19 01:20:23 UTC
Responsible Changed
From-To: freebsd-ports-bugs->garga

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer 2011-11-19 14:31:31 UTC
garga       2011-11-19 14:31:23 UTC

  FreeBSD ports repository

  Modified files:
    net/rinetd           Makefile 
    net/rinetd/files     patch-rinetd.c 
  Log:
  rinetd fails to close the configuration file (fopen twice, fclose only once)
  when reading its configuration. Therefore on every configuration reload
  (through SIGHUP) one file descriptor is lost. In an environment where this is
  done frequently (e.g. to re-lookup DNS names) the system will run out of file
  descriptors soon (kern.maxfiles) until rinetd crashes.
  
  PR:             ports/162673
  Submitted by:   Michael Gmelin <freebsd@grem.de>
  Feature safe:   yes
  
  Revision  Changes    Path
  1.21      +1 -1      ports/net/rinetd/Makefile
  1.2       +8 -0      ports/net/rinetd/files/patch-rinetd.c
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 3 Renato Botelho freebsd_committer 2011-11-19 14:31:37 UTC
State Changed
From-To: open->closed

Committed. Thanks!