From owner-freebsd-ports@FreeBSD.ORG Tue Feb 15 12:38:30 2011 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF507106566C; Tue, 15 Feb 2011 12:38:30 +0000 (UTC) (envelope-from marius@nuenneri.ch) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id 72AD68FC18; Tue, 15 Feb 2011 12:38:30 +0000 (UTC) Received: by qyk8 with SMTP id 8so1917066qyk.13 for ; Tue, 15 Feb 2011 04:38:29 -0800 (PST) Received: by 10.229.233.74 with SMTP id jx10mr3915349qcb.97.1297773509527; Tue, 15 Feb 2011 04:38:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.214.200 with HTTP; Tue, 15 Feb 2011 04:38:08 -0800 (PST) In-Reply-To: <86oc6dzf1z.fsf@chateau.d.if> References: <86bp2d1wit.fsf@chateau.d.if> <86oc6dzf1z.fsf@chateau.d.if> From: =?UTF-8?Q?Marius_N=C3=BCnnerich?= Date: Tue, 15 Feb 2011 13:38:08 +0100 Message-ID: To: Ashish SHUKLA Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-ports@freebsd.org Subject: Re: pdnsd leaking udp sockets X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2011 12:38:30 -0000 On Tue, Feb 15, 2011 at 12:56, Ashish SHUKLA wrote: > Marius N=C3=BCnnerich 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 fi= xed > that. You can test the diff[1] to see if it fixes issue you're experienci= ng. > > To reproduce this at my end, I switched to 'resolv.conf' server method an= d > 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 =C2=A0|fgrep pdns > nobody =C2=A0 pdnsd =C2=A0 =C2=A0 =C2=A038434 3 =C2=A0tcp4 =C2=A0 *:53 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*:* > nobody =C2=A0 pdnsd =C2=A0 =C2=A0 =C2=A038434 4 =C2=A0udp4 =C2=A0 *:* =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 *:* > nobody =C2=A0 pdnsd =C2=A0 =C2=A0 =C2=A038434 5 =C2=A0udp4 =C2=A0 *:53 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*:* > #v- > > And with the diff applied: > > #v+ > chateau.d.if!abbe:~ % sockstat -64 =C2=A0|fgrep pdns > nobody =C2=A0 pdnsd =C2=A0 =C2=A0 =C2=A043666 3 =C2=A0tcp4 =C2=A0 *:53 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*:* > nobody =C2=A0 pdnsd =C2=A0 =C2=A0 =C2=A043666 4 =C2=A0udp4 =C2=A0 *:53 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*:* > #v- > > References: > [1] =C2=A0http://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! :)