From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePjgL-0005qj-Dg for qemu-devel@nongnu.org; Fri, 15 Dec 2017 01:41:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePjgI-00026R-9B for qemu-devel@nongnu.org; Fri, 15 Dec 2017 01:41:17 -0500 Received: from indium.canonical.com ([91.189.90.7]:41238) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ePjgI-00025d-2X for qemu-devel@nongnu.org; Fri, 15 Dec 2017 01:41:14 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.86_2 #2 (Debian)) id 1ePjgG-0004qx-Uq for ; Fri, 15 Dec 2017 06:41:12 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id E76882E80C3 for ; Fri, 15 Dec 2017 06:41:12 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Fri, 15 Dec 2017 06:33:22 -0000 From: Bruno Haible Reply-To: Bug 1705118 <1705118@bugs.launchpad.net> Sender: bounces@canonical.com References: <150041005567.6544.17518405784140614257.malonedeb@gac.canonical.com> Message-Id: <151331960217.16639.16859590248777600587.malone@soybean.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1705118] Re: qemu user mode does not support catching SIGSEGV on some architectures List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org I confirm that in qemu-2.11, the ppc and s390x cases are fixed, however the sparc64 case is still failing: $ ~/inst-qemu/2.11.0/bin/qemu-ppc testsigsegv-ppc $ echo $? 0 $ ~/inst-qemu/2.11.0/bin/qemu-ppc64 testsigsegv-ppc64 $ echo $? 0 $ ~/inst-qemu/2.11.0/bin/qemu-ppc64le testsigsegv-ppc64le $ echo $? 0 $ ~/inst-qemu/2.11.0/bin/qemu-s390x testsigsegv-s390x $ echo $? 0 $ ~/inst-qemu/2.11.0/bin/qemu-s390x testsigsegv-s390x-a $ echo $? 3 $ ~/inst-qemu/2.11.0/bin/qemu-sparc64 testsigsegv-sparc64 setup_rt_frame: not implemented Segmentation fault (core dumped) -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1705118 Title: qemu user mode does not support catching SIGSEGV on some architectures Status in QEMU: Confirmed Bug description: The documentation says that qemu in user mode supports POSIX signal handling. Catching SIGSEGV according to POSIX, however, does not work on ppc, ppc64, ppc64le, s390x, sparc64. It does work, however, on aarch64, alpha, arm, hppa, m68k, mips, mips64, sh4. How to reproduce: The attached program runs fine (exits with code 0) on - real hardware Linux/PowerPC64 (in 32-bit and 64-bit mode), - real hardware Linux/PowerPC64LE, - qemu-system-s390x emulated Linux/s390x, - real hardware Linux/SPARC64. $ gcc -O -Wall testsigsegv.c; ./a.out; echo $? 0 For ppc: $ powerpc-linux-gnu-gcc-5 -O -Wall -static testsigsegv.c -o testsigsegv-p= pc $ ~/inst-qemu/2.9.0/bin/qemu-ppc testsigsegv-ppc $ echo $? 3 For ppc64: $ powerpc64-linux-gnu-gcc-5 -O -Wall -static testsigsegv.c -o testsigsegv= -ppc64 $ ~/inst-qemu/2.9.0/bin/qemu-ppc64 testsigsegv-ppc64 $ echo $? 3 For ppc64le: $ powerpc64le-linux-gnu-gcc-5 -O -Wall -static testsigsegv.c -o testsigse= gv-ppc64le $ ~/inst-qemu/2.9.0/bin/qemu-ppc64le testsigsegv-ppc64le $ echo $? 3 For s390x: $ s390x-linux-gnu-gcc-5 -O -Wall -static testsigsegv.c -o testsigsegv-s39= 0x $ ~/inst-qemu/2.9.0/bin/qemu-s390x testsigsegv-s390x $ echo $? 3 $ s390x-linux-gnu-gcc-5 -O -Wall -static testsigsegv.c -DAVOID_LINUX_S390= X_COMPAT -o testsigsegv-s390x-a $ ~/inst-qemu/2.9.0/bin/qemu-s390x testsigsegv-s390x-a $ echo $? 0 So, the test fails here because the Linux/s390x kernel omits the least significant 12 bits of the fault address in the 'si_addr' field. But qemu-s390x is not compatible with the Linux/s390x behaviour: it puts the complete fault address in the 'si_addr' field. For sparc64: $ sparc64-linux-gnu-gcc-5 -O -Wall -static testsigsegv.c -o testsigsegv-s= parc64 $ ~/inst-qemu/2.9.0/bin/qemu-sparc64 testsigsegv-sparc64 Segmentation fault (core dumped) To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1705118/+subscriptions