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] xenbus stress testing

To: James Harper <james.harper@xxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] xenbus stress testing
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Fri, 18 Feb 2011 12:05:24 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Delivery-date: Fri, 18 Feb 2011 03:06:28 -0800
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1298027132; l=629; s=domk; d=aepfle.de; h=In-Reply-To:Content-Type:MIME-Version:References:Subject:Cc:To:From: Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=Q95XZ5ElrJQ03CTmPpoHDfWg6L4=; b=QW+up55Mmw59+BVyDw7ujDIf0jMUoKrfAbAu3kFs+NrL1xoJhmf8qxwUTEEh11i7pzj TARJjRyNa8PCQomkUwXwgC75/+CYEqHOD3ZmAQ8RjSYnW5JHOitnlnw8drz0M1Pa0a8hz xvqovqQq5Pzq1d0FGhcTZN5JBQvurRXotPQ=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <AEC6C66638C05B468B556EA548C1A77D01C556C5@trantor>
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: <AEC6C66638C05B468B556EA548C1A77D01C556B6@trantor> <19805.29093.996401.185391@xxxxxxxxxxxxxxxxxxxxxxxx> <AEC6C66638C05B468B556EA548C1A77D01C556C5@trantor>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.20 (2009-06-14)
On Fri, Feb 18, James Harper wrote:

> I think I have found the error and it was probably a 1 in a million race
> so stress testing might not have helped anyway. My code went:
> 
> len = min(ring->rsp_prod - ring->rsp_cons, msg_size)
> 
> and the ASSERT was hit because len was > msg_size, and the only possible
> way I can ever see that happening is if ring->rsp_prod changed between
> the if in the min() and the assignment. I'm now snapshotting rsp_prod to
> a local variable at the start. Kind of embarrassing really as plenty of
> example code exists.

Why is there no lock to protect the ring accesses?

Olaf

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