From patchwork Mon Dec 17 20:26:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Bolshakov X-Patchwork-Id: 1014761 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=yadro.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=yadro.com header.i=@yadro.com header.b="oD6TCHTg"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43JY8D3j0Tz9s2P for ; Tue, 18 Dec 2018 07:45:48 +1100 (AEDT) Received: from localhost ([::1]:49463 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYzlq-0003Y4-5A for incoming@patchwork.ozlabs.org; Mon, 17 Dec 2018 15:45:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48696) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYzhj-00005K-JZ for qemu-devel@nongnu.org; Mon, 17 Dec 2018 15:41:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gYzTa-0005FA-IM for qemu-devel@nongnu.org; Mon, 17 Dec 2018 15:26:58 -0500 Received: from mta-01.yadro.com ([89.207.88.251]:45310) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gYzTa-0005By-2M for qemu-devel@nongnu.org; Mon, 17 Dec 2018 15:26:54 -0500 Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id E67C34193F for ; Mon, 17 Dec 2018 20:26:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-type:content-type:content-transfer-encoding:mime-version :x-mailer:message-id:date:date:subject:subject:from:from :received:received:received; s=mta-01; t=1545078410; x= 1546892811; bh=VeIgkplaGeaSKz8z7G4s+FzbeXNsp7gcB1uonawDoSI=; b=o D6TCHTgl34r3OQI5mGv+0roiMeXH0XpF47RZnnVhQzyHd1/BY9/79ulcVkbHocbg q1y2waMDG5H+GS3WzW1IQqA1CCJdq9pgYvNufwisJDI05QbubmoPhskwYNuSQUUk bJqSW9vm3lE1Fut+TlM7fXcZZyNiYVdt1O32PKBims= X-Virus-Scanned: amavisd-new at yadro.com Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NTwVaPT72DsL for ; Mon, 17 Dec 2018 23:26:50 +0300 (MSK) Received: from T-EXCH-02.corp.yadro.com (t-exch-02.corp.yadro.com [172.17.10.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id 174674193A for ; Mon, 17 Dec 2018 23:26:49 +0300 (MSK) Received: from localhost (172.17.1.6) by T-EXCH-02.corp.yadro.com (172.17.10.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Mon, 17 Dec 2018 23:26:49 +0300 From: Roman Bolshakov To: Date: Mon, 17 Dec 2018 23:26:00 +0300 Message-ID: <20181217202602.31113-1-r.bolshakov@yadro.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-Originating-IP: [172.17.1.6] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-02.corp.yadro.com (172.17.10.102) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 89.207.88.251 Subject: [Qemu-devel] [RFC 0/2] Improve qemu-thread support on macOS 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: Roman Bolshakov Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Hello, I've hit a case where QEMU hangs not responding to anything except SIGKILL. It turned out to be a SIGSEGV in vCPU thread that was lost by masking all signals. By blocking too many signals QEMU relies on undefined behaviour that seems to work on Linux. It's documented in POSIX reference and sigprocmask(2). Indeed signalfd(2) on Linux notes that it can't be used to receive SIGSEGV and SIGFPE. It's not clear what do with SIGBUS on macOS. We can't blindly unblock it as it's used for memory preallocation. Also the RFC adds support for thread naming on macOS. Some threads (signalfd_compat and rcu_call) are created before debug-threads=on is parsed and don't get their names though. Thank you, Roman Roman Bolshakov (2): util: Implement debug-threads for macOS qemu-thread: Don't block SEGV, ILL and FPE configure | 32 ++++++++++++++++++++++++++------ qemu-options.hx | 4 ++-- util/qemu-thread-posix.c | 11 ++++++++++- 3 files changed, 38 insertions(+), 9 deletions(-)