[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] tools/xenstore: domain can sometimes disappear when destroying connection



On Thu, Nov 29, 2018 at 01:38:11PM +0000, Wei Liu wrote:
> On Thu, Nov 29, 2018 at 01:10:52PM +0000, Eftime, Petre wrote:
> > I didn't go extremely deep in my debugging, as the talloc library is a bit
> > difficult to debug, but under the do_introduce function you have these
> > two lines:
> 
> difficult to debug> I completely agree. ;-)
> 
> > 
> >                  /* Now domain belongs to its connection. */
> >                  talloc_steal(domain->conn, domain);
> > 
> 
> Thanks, I think this is what I missed. This is useful information. I
> think it should go into the commit message if we end up committing your
> patch.
> 

I have taken a closer look. I don't think the circular link exists. Note
that a new connection is always created with talloc_autofree_context.

Following the code, we get (to distinguish, I use conn(X)):

 conn(1) <- belongs to talloc_autofree_context, created by new_connection when
            accepting connection from sockets.
 
 conn(1)->in <- allocated with new_buffer, belongs to conn(1).
 
 domain <- allocated with new_domain, belongs to conn(1)->in .
 
 domain->conn(2) <- allocated with new_connection, belongs to 
talloc_autofree_context.
 
 talloc_steal(domain->conn(2), domain) <- now domain belongs to conn(2).

So the n-ary tree ends up like:

  talloc_autofree_context->conn(1)->in
      \->conn(2)->domain

Ian, can I have a second opinion from you?

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.