From owner-freebsd-net Fri Mar 9 7:30:26 2001 Delivered-To: freebsd-net@freebsd.org Received: from filk.iinet.net.au (syncopation-dns.iinet.net.au [203.59.24.29]) by hub.freebsd.org (Postfix) with SMTP id B48C037B719 for ; Fri, 9 Mar 2001 07:30:22 -0800 (PST) (envelope-from julian@elischer.org) Received: (qmail 30565 invoked by uid 666); 9 Mar 2001 15:31:16 -0000 Received: from i079-234.nv.iinet.net.au (HELO elischer.org) (203.59.79.234) by mail.m.iinet.net.au with SMTP; 9 Mar 2001 15:31:16 -0000 Message-ID: <3AA8F6F2.99480745@elischer.org> Date: Fri, 09 Mar 2001 07:29:54 -0800 From: Julian Elischer X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 5.0-CURRENT i386) X-Accept-Language: en, hu MIME-Version: 1.0 To: Harti Brandt Cc: julian@freebsd.org, net@freebsd.org Subject: Re: Netgraph is leaking node references References: Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Thanks Harti. I'll look at it (again) I thought I had fixed these.. oh well maybe I broke it again.. Hooks hold a reference on the node until their own references go to 0. The node holds a reference on teh hook, but the cycle is handled in the hook removal code. Since node removal first calls hook removal on each hook, and removes it's reference, it should all work out. I'll go through the logic again now. I must have forgotten something :-( Harti Brandt wrote: > > Hi, > > it seems that netgraph is leaking references. One simple experiment to do > is to repeat 'ngctl types' several times: > > 500 [root] (beagle) netgraph_atm/tests/ccatm # ngctl types > There are 5 total types: > Type name Number of living nodes > --------- ---------------------- > socket 9 > sscfu 0 > sscop 1 > atm 2 > tee 0 > 501 [root] (beagle) netgraph_atm/tests/ccatm # ngctl types > There are 5 total types: > Type name Number of living nodes > --------- ---------------------- > socket 10 > sscfu 0 > sscop 1 > atm 2 > tee 0 > 502 [root] (beagle) netgraph_atm/tests/ccatm # ngctl types > There are 5 total types: > Type name Number of living nodes > --------- ---------------------- > socket 11 > sscfu 0 > sscop 1 > atm 2 > tee 0 > 503 [root] (beagle) netgraph_atm/tests/ccatm # exit > > See the number of socket type nodes increasing. A ngctl list shows only > the two persistant atm nodes and the ngctl socket node. Dumping the node > list shows, that all the nodes have 0 hooks, are INVALID and CLOSING, but > have references. This happens for all types (the sscop nodes above is one > of these stuck nodes). The leaking references are probably hook > references, because the number of dangling references in the dead nodes > depends on the number of hooks it previously had. > > So what is the problem? > harti > > PS: > FreeBSD beagle.fokus.gmd.de 5.0-CURRENT FreeBSD 5.0-CURRENT #5: Thu Mar 8 11:42:04 CET 2001 > hbb@beagle.fokus.gmd.de:/opt/obj/usr/src/sys/BEAGLE i386 > -- > harti brandt, http://www.fokus.gmd.de/research/cc/cats/employees/hartmut.brandt/private > brandt@fokus.gmd.de, harti@begemot.org -- __--_|\ Julian Elischer / \ julian@elischer.org ( OZ ) World tour 2000-2001 ---> X_.---._/ v To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message