Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: File descriptor leak involving kqueue



In article <20161218124436.GA8939%britannica.bec.de@localhost>,
Joerg Sonnenberger  <joerg%bec.de@localhost> wrote:
>On Tue, Dec 13, 2016 at 07:58:22PM +0100, Tom Ivar Helbekkmo wrote:
>> Lately, I'm running my postfix with opendkim and opendmarc milters (both
>> from pkgsrc).  Something about opendmarc is bleeding the system empty of
>> file handles, and I'd appreciate some help thinking about how to find
>> out exactly what's going on.
>
>It seems pretty obvious that OpenDMARC is not correctly managing
>ressources. It creates an on-stack res_state, initialized it with
>res_ninit, but never destroys it. Arguable, res_nclose should free the
>associated kqueue for the /etc/resolv.conf watcher, but the code is
>certainly leaky and wrong.

The comment in res_nclose() says it should not be user visible. It was
created just to support endhostent(). Unless you are simulating this
specific cause you should not be using res_nclose(), but res_ndestroy()
instead (which calls res_nclose() for you).

I think I should improve the documentation in the man pages.

christos



Home | Main Index | Thread Index | Old Index