From patchwork Thu Jul 28 15:44:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 9251433 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 463696075F for ; Thu, 28 Jul 2016 16:07:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35E8827D4A for ; Thu, 28 Jul 2016 16:07:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2934727D64; Thu, 28 Jul 2016 16:07:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B5E8627D4A for ; Thu, 28 Jul 2016 16:07:36 +0000 (UTC) Received: from localhost ([::1]:54297 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSnqR-0008Ln-Gk for patchwork-qemu-devel@patchwork.kernel.org; Thu, 28 Jul 2016 12:07:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSncR-0003Ug-Hu for qemu-devel@nongnu.org; Thu, 28 Jul 2016 11:53:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSncP-0001oz-Ng for qemu-devel@nongnu.org; Thu, 28 Jul 2016 11:53:06 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:58492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSncP-0001ou-H7 for qemu-devel@nongnu.org; Thu, 28 Jul 2016 11:53:05 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1bSnUR-0003Xt-Th; Thu, 28 Jul 2016 16:44:51 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 28 Jul 2016 16:44:45 +0100 Message-Id: <1469720690-32060-2-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1469720690-32060-1-git-send-email-peter.maydell@linaro.org> References: <1469720690-32060-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH 1/6] linux-user: Recheck for pending synchronous signals too X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , patches@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP In process_pending_signals() we restart the scan of possible pending signals after calling handle_pending_signal() in case some other signal has been generated. This rescan should also include a check for a new synchronous signal since those are in fact the only kind of new signal that the signal frame setup process might produce. Signed-off-by: Peter Maydell --- linux-user/signal.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index 85976da..87871ce 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -5925,6 +5925,7 @@ void process_pending_signals(CPUArchState *cpu_env) sigfillset(&set); sigprocmask(SIG_SETMASK, &set, 0); + restart_scan: sig = ts->sync_signal.pending; if (sig) { /* Synchronous signals are forced, @@ -5952,8 +5953,10 @@ void process_pending_signals(CPUArchState *cpu_env) (!sigismember(blocked_set, target_to_host_signal_table[sig]))) { handle_pending_signal(cpu_env, sig, &ts->sigtab[sig - 1]); - /* Restart scan from the beginning */ - sig = 1; + /* Restart scan from the beginning, as handle_pending_signal + * might have resulted in a new synchronous signal (eg SIGSEGV). + */ + goto restart_scan; } }