From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TohCy-0001RC-BL for qemu-devel@nongnu.org; Fri, 28 Dec 2012 16:11:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TohCw-00080X-1b for qemu-devel@nongnu.org; Fri, 28 Dec 2012 16:11:12 -0500 Received: from speedy.comstyle.com ([2001:470:1d:8c::2]:36731 helo=mail.comstyle.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TohCv-00080E-Tt for qemu-devel@nongnu.org; Fri, 28 Dec 2012 16:11:09 -0500 Date: Fri, 28 Dec 2012 16:11:04 -0500 From: Brad Smith Message-ID: <20121228211101.GF27232@rox.home.comstyle.com> References: <20121228060022.GB27232@rox.home.comstyle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] Fix semaphores fallback code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org On Fri, Dec 28, 2012 at 08:13:37PM +0000, Blue Swirl wrote: > On Fri, Dec 28, 2012 at 6:00 AM, Brad Smith wrote: > > As reported in bug 1087114 the semaphores fallback code is broken which > > results in QEMU crashing and making QEMU unusable. > > > > This patch is from Paolo. > > > > This needs to be back ported to the 1.3 stable tree as well. > > Needs to be back ported to HEAD as well because of the reorganization, > or applied after Paolo's series. > > > > > Signed-off-by: Paolo Bonzini > > Signed-off-by: Brad Smith Here is a patch applied to HEAD. diff --git a/qemu-thread-posix.c b/qemu-thread-posix.c index 6374df3..4489abf 100644 --- a/qemu-thread-posix.c +++ b/qemu-thread-posix.c @@ -213,6 +213,7 @@ int qemu_sem_timedwait(QemuSemaphore *sem, int ms) while (sem->count < 0) { rc = pthread_cond_timedwait(&sem->cond, &sem->lock, &ts); if (rc == ETIMEDOUT) { + ++sem->count; break; } if (rc != 0) { -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.