WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] tiddyup tools/xenstore/talloc.c

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] tiddyup tools/xenstore/talloc.c
From: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
Date: Fri, 12 Aug 2005 13:32:08 +1000
Cc: Jerone Young <jyoung5@xxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 12 Aug 2005 03:31:05 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <93d31f0a8151dc28568a23929efeded8@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1123794926.3043.56.camel@thinkpad> <93d31f0a8151dc28568a23929efeded8@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Thu, 2005-08-11 at 22:58 +0100, Keir Fraser wrote:
> On 11 Aug 2005, at 22:15, Jerone Young wrote:
> 
> > Add check so that p is not operated on if context is not also null.
> >
> > Signed-off-by: Jerone Young <jyoung5@xxxxxxxxxx>
> 
> No idea on this one. I think that case is probably impossible so the 
> test could just be simplified, but probably only tridge knows for sure. 
> :-)

Actually the code is fine: it looks for a reference to the given parent
context.  p + 1 cannot be NULL, since either p is NULL, or (p + 1) has
at some stage been returned by _talloc(), which cannot return NULL.

> I think xenstore can probably be weaned off talloc at some point.

Heh, good luck with that!  Removing the destructors and replacing them
with explicit calls would not be too complicated, as the structures are
all fairly simple, but you'll be chasing down memory leaks for a long
time through all the failure paths.

You will have lots and lots of fun handling out-of-memory conditions,
which we do at the moment although, regrettably, not everywhere: if
destroy_path() fails we abort the daemon 8(.

Actually, the OOM code is ugly and I'd love to get rid of it, but I know
people like these kind of checks, even if they're never 100%.

Rusty.
-- 
A bad analogy is like a leaky screwdriver -- Richard Braakman


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>