pdnsd leaking udp sockets

Marius Nünnerich marius at nuenneri.ch
Tue Feb 15 12:38:30 UTC 2011


On Tue, Feb 15, 2011 at 12:56, Ashish SHUKLA <ashish at freebsd.org> wrote:
> Marius Nünnerich writes:
>> Hi Ashish,
>
> [...]
>
>> dmesg and messages are clean. My FreeBSD ist 8.0-RELEASE/amd64.
>> I took a look at the code too but couldn't see anything suspicious. I
>> don't have time right now but one idea would be to add some dtrace
>> probes to the source.
>
> I looked at the source code, and found a place where it's leaking socket
> descriptors, but I'm not sure if this is the major source of impact. I fixed
> that. You can test the diff[1] to see if it fixes issue you're experiencing.
>
> To reproduce this at my end, I switched to 'resolv.conf' server method and
> commented 'server_ip' in the pdnsd.conf(5). Following are the contents of the
> resolv.conf(5):
>
> #v+
> chateau.d.if!abbe:~ % cat /etc/resolv.conf
> nameserver 127.0.0.1
> nameserver 4.2.2.2
> #v-
>
> Before applying the diff, it is leaking following socket descriptor:
>
> #v+
> chateau.d.if!abbe:~ % sockstat -64  |fgrep pdns
> nobody   pdnsd      38434 3  tcp4   *:53                  *:*
> nobody   pdnsd      38434 4  udp4   *:*                   *:*
> nobody   pdnsd      38434 5  udp4   *:53                  *:*
> #v-
>
> And with the diff applied:
>
> #v+
> chateau.d.if!abbe:~ % sockstat -64  |fgrep pdns
> nobody   pdnsd      43666 3  tcp4   *:53                  *:*
> nobody   pdnsd      43666 4  udp4   *:53                  *:*
> #v-
>
> References:
> [1]  http://people.freebsd.org/~ashish/diffs/pdnsd-sockets-leak.diff

Ok, I applied the patch and reinstalled the port. I will leave it
running for a few days and report back. So far it's looking good.
Thank you very much! :)


More information about the freebsd-ports mailing list