[DGD] Circular Object Links

Felix A. Croes felix at dworkin.nl
Sat Apr 20 12:12:50 CEST 2013


Blain <blain20 at gmail.com> wrote:

> I put some functions in objregd so I could inspect the contents of the
> links mapping and gather up all objects of a given user for debugging.  I
> found a problem.  Just to be sure it wasn't something I did on accident, I
> tested it with a stock kernel-networking klib and it also had the problem.
>
> The function I put into objregd for testing simply grabs the link for the
> given owner and then loops through link->_Q_next() and builds an array.
>  The first time I did this, I ran out of ticks.  So to inspect what was
> going on, I put in a if(!random(100) break;  The result was an array with
> my wiztool and tons of "/usr/admin/_code" objects.  So it would appear that
> /usr/admin/_code points to itself for next and prev (I switch to use
> _Q_prev() just to be sure).  Is this normal for an LWO to only point to
> itself, yet other persistent objects point to LWO's?  I wonder if this can
> cause problems elsewhere...  I'm wondering if the proper fix is to exclude
> LWO's from the objregd or maybe keep them in a separate links list, or if
> they should properly update their next/prev links to other objects.  I
> don't think the latter is good because LWO's are deallocated.  However, I'm
> wondering if my wiztool is keeping the _code LWO alive since it points to
> it (or a copy of it).

</usr/admin/_code> is not a light-weight object.  Light-weight objects
are not in objregd's linked list.  However, that linked list is
circular, and it will contain your wiztool and and active _code object.

Given your considerable confusion, I am not yet convinced that there is
anything wrong with the circular linked list :)

Regards,
Felix Croes



More information about the DGD mailing list