From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: xenbus stress testing Date: Fri, 18 Feb 2011 12:05:24 +0100 Message-ID: <20110218110524.GA10012@aepfle.de> References: <19805.29093.996401.185391@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: James Harper Cc: xen-devel@lists.xensource.com, Ian Jackson List-Id: xen-devel@lists.xenproject.org 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