Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Mar 2001 07:29:54 -0800
From:      Julian Elischer <julian@elischer.org>
To:        Harti Brandt <brandt@fokus.gmd.de>
Cc:        julian@freebsd.org, net@freebsd.org
Subject:   Re: Netgraph is leaking node references
Message-ID:  <3AA8F6F2.99480745@elischer.org>
References:  <Pine.BSF.4.33.0103091154590.470-100000@beagle.fokus.gmd.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3AA8F6F2.99480745>