From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSOP3-00074l-PC for qemu-devel@nongnu.org; Thu, 10 May 2012 04:07:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSOP1-00037i-PP for qemu-devel@nongnu.org; Thu, 10 May 2012 04:07:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16962) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSOP1-00037e-HQ for qemu-devel@nongnu.org; Thu, 10 May 2012 04:07:11 -0400 Message-ID: <4FAB7728.7090601@redhat.com> Date: Thu, 10 May 2012 10:07:04 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <4FAAA80F.1060806@siemens.com> <4FAB6E5B.9040101@redhat.com> In-Reply-To: <4FAB6E5B.9040101@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1.1] coroutine: Fix setup of sigaltstack coroutines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Jan Kiszka , qemu-devel Am 10.05.2012 09:29, schrieb Paolo Bonzini: > Il 09/05/2012 19:23, Jan Kiszka ha scritto: >> Use pthread_kill instead of process-wide kill to invoke the signal >> handler used for stack switching. This may fix spurious lock-ups with >> this backend, easily triggerable by extending the time window between >> kill and sigsuspend. >> >> Signed-off-by: Jan Kiszka >> --- >> coroutine-sigaltstack.c | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/coroutine-sigaltstack.c b/coroutine-sigaltstack.c >> index 7ff2d33..b2e316c 100644 >> --- a/coroutine-sigaltstack.c >> +++ b/coroutine-sigaltstack.c >> @@ -226,7 +226,7 @@ static Coroutine *coroutine_new(void) >> * called. >> */ >> coTS->tr_called = 0; >> - kill(getpid(), SIGUSR2); >> + pthread_kill(pthread_self(), SIGUSR2); >> sigfillset(&sigs); >> sigdelset(&sigs, SIGUSR2); >> while (!coTS->tr_called) { > > Reviewed-by: Paolo Bonzini Thanks, applied to the block branch for 1.1. Kevin