[Opendnssec-user] File Descriptor Leak in Trunk?

Matthijs Mekking matthijs at NLnetLabs.nl
Mon Nov 1 09:50:05 UTC 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Fixed this in r4149. Thanks for your report!

Best regards,
Matthijs

On 11/01/2010 03:51 AM, James Dempsey wrote:
> Hello all,
> 
> I have noticed that in the OpenDNSSEC trunk, ods-signerd accumulates a
> connection to /var/run/opendnssec/engine.sock each time a command is
> issued to the signer.  Eventually, ods-signerd will stop operating when
> the open file limit is reached.
> 
> strace reveals ods-signerd is doing the following once it hits 1024 open
> files:
> ...
> [pid  4021] select(6, [5], NULL, NULL, NULL) = 1 (in [5])
> [pid  4021] accept(5, 0x7f1109b1ce20, [110]) = -1 EMFILE (Too many open
> files)
> [pid  4021] select(6, [5], NULL, NULL, NULL) = 1 (in [5])
> [pid  4021] accept(5, 0x7f1109b1ce20, [110]) = -1 EMFILE (Too many open
> files)
> ...
> 
> It looks like in ./src/daemon/cmdhandler.c, close is never called on the
> socket that is opened by cmdhandler_start().  The following patch seems
> to resolve the problem for me:
> 
> --- cmdhandler.c (revision 4141)
> +++ cmdhandler.c (working copy)
> @@ -857,6 +857,8 @@
>  void
>  cmdhandler_cleanup(cmdhandler_type* cmdhandler)
>  {
> +    if (cmdhandler->client_fd > 0)
> +        close(cmdhandler->client_fd);
>      if (cmdhandler) {
>          se_free((void*)cmdhandler);
>      } else {
> 
> 
> Cheers,
> James Dempsey
> 
> 
> 
> _______________________________________________
> Opendnssec-user mailing list
> Opendnssec-user at lists.opendnssec.org
> https://lists.opendnssec.org/mailman/listinfo/opendnssec-user
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJMzo1NAAoJEA8yVCPsQCW529IH/0BQO2hR91rAApXIXhOc9AwE
dE1G/GYm/K1NZNGerUKyzkboikSUn9krz3aXT9dOa+N69x1iAR8pVPnNXApVHMZX
YftcIe3M4zdYZvLmjtMYH31ct8fI98i9I3PooWHplcM4sWziAiuo/omN1gimz1Bi
J7SaPAk9HTnHd09w90DBCEdkNulD/s/tjp/D5sH6vKetUtaUvz1LeI+7k8h4A5DE
uvBGoQhyX13POt/u6UULjL671vnzPH0e7frkXW06oDVAYZU7Ml8+xJdDpcnvixMC
01Heoy2QjwB/OUD0DaQhAoPU6SpgJAZaJTiJASFp++4wPiATP/dHOcfV1eBNkss=
=pCfC
-----END PGP SIGNATURE-----



More information about the Opendnssec-user mailing list