From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NmFcE-0000ge-Bp for qemu-devel@nongnu.org; Mon, 01 Mar 2010 19:05:34 -0500 Received: from [199.232.76.173] (port=36081 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NmFcD-0000gW-0m for qemu-devel@nongnu.org; Mon, 01 Mar 2010 19:05:33 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NmFcB-0000tw-IT for qemu-devel@nongnu.org; Mon, 01 Mar 2010 19:05:32 -0500 Received: from hall.aurel32.net ([88.191.82.174]:40422) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NmFcB-0000ts-87 for qemu-devel@nongnu.org; Mon, 01 Mar 2010 19:05:31 -0500 Date: Tue, 2 Mar 2010 01:05:29 +0100 From: Aurelien Jarno Message-ID: <20100302000529.GO8952@hall.aurel32.net> References: <20100301213351.GN8952@hall.aurel32.net> <4B8C40B3.6030008@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <4B8C40B3.6030008@redhat.com> Sender: Aurelien Jarno Subject: [Qemu-devel] Re: Regression: segfault on ARM host List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel On Mon, Mar 01, 2010 at 11:33:23PM +0100, Paolo Bonzini wrote: > On 03/01/2010 10:33 PM, Aurelien Jarno wrote: >> While trying to implement setcond on TCG ARM, I have discovered it does >> not work anymore. I have bisected this regression to: >> >> commit 6113d6d3169393c323ac4c82d756a850145a5e7a >> Author: Paolo Bonzini >> Date: Fri Jan 15 09:42:09 2010 +0100 >> >> change while to if >> >> The while loop will be executed exactly 0 or 1 times, depending on >> env->exit_request. >> >> Signed-off-by: Paolo Bonzini >> Signed-off-by: Anthony Liguori >> >> The assertion is actually triggered. When the next patch removing the >> assertion is also applied it segfaults instead. > > Looks like a race. The only piece of logic that is changed by that > commit is reverted in the attached patch, can you try it? If it passes, > I can resubmit with S-o-b. Unfortunately it doesn't work. > If it doesn't pass, I wonder whether the while loop was there to trick > the compiler into not optimizing something. Seems a bit too clever > though. > It looks like it is the case. Just replacing the if by a while in your patch make it working again. But I do wonder what this trick is actually preventing, as there is probably a better way to prevent that. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net