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] lowlevel: Fix Segmentation fault of xend

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] lowlevel: Fix Segmentation fault of xend
From: Yu Zhiguo <yuzg@xxxxxxxxxxxxxx>
Date: Tue, 22 Jun 2010 08:58:32 +0800
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Mon, 21 Jun 2010 18:01:20 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <19487.28964.896548.315319@xxxxxxxxxxxxxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4C1C6245.9050402@xxxxxxxxxxxxxx> <19487.28964.896548.315319@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 3.0a1 (Windows/2008050715)
Hi Ian,

Ian Jackson wrote:
> 
> It is wrong to call xc_clear_last_error with a NULL xc_interface*.
> If xend is doing this it is probably a bug in the python xc lowlevel
> interface.  Can you get a stack trace please so that we can fix the
> call site ?
> 


The stack trace is
 PyXc_init()
  -> pyxc_error_to_exception(0)
   -> xc_clear_last_error()

So fix it in pyxc_error_to_exception(). Thanks for your reply.

V2 is following.

-----------------

If /proc/xen/privcmd cannot be opened,
start xend occurs Segmentation fault.
Add check to fix it.

Signed-off-by: Yu Zhiguo <yuzg@xxxxxxxxxxxxxx>

diff -r 72c6228b5f0f -r bd3bf925f4ce tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Mon Jun 21 19:19:25 2010 +0100
+++ b/tools/python/xen/lowlevel/xc/xc.c Tue Jun 22 17:02:30 2010 +0800
@@ -72,7 +72,8 @@
     else
         pyerr = Py_BuildValue("(is)", err->code, desc);
 
-    xc_clear_last_error(xch);
+    if (xch)
+        xc_clear_last_error(xch);
 
     if ( pyerr != NULL )
     {


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