Received: from eggs.gnu.org ([2001:4830:134:3::10]:52044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIC0s-0007Vx-JX for qemu-devel@nongnu.org; Mon, 02 Feb 2015 03:05:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIC0p-0001TA-Cb for qemu-devel@nongnu.org; Mon, 02 Feb 2015 03:05:42 -0500 Received: from indium.canonical.com ([91.189.90.7]:49042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIC0p-0001Sp-6m for qemu-devel@nongnu.org; Mon, 02 Feb 2015 03:05:39 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.76 #1 (Debian)) id 1YIC0o-0008Vc-9z for ; Mon, 02 Feb 2015 08:05:38 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 033892E80C9 for ; Mon, 2 Feb 2015 08:05:38 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Mon, 02 Feb 2015 07:58:25 -0000 From: Maxim Ostapenko Sender: bounces@canonical.com References: <20150202075825.28894.71400.malonedeb@gac.canonical.com> Message-Id: <20150202075825.28894.71400.malonedeb@gac.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1416988] [NEW] Wrong signal handling in qemu-aarch64. Reply-To: Bug 1416988 <1416988@bugs.launchpad.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Public bug reported: Running GCC 5.0 testsuite under qemu-aarch64, I noticed that tests connected with stack unwinding fail with: qemu: uncaught target signal 11 (Segmentation fault) - core dumped or run into infinite loop. Here is one example: $ /home/max/build/gcc-aarch64/gcc/xgcc -B/home/max/build/gcc- aarch64/gcc/ /home/max/src/toolchain/gcc/gcc/testsuite/gcc.dg/cleanup-11.c -fexceptions -fnon-call-exceptions -O2 -lm -o ./cleanup-11.exe $ qemu-aarch64 -L /home/max/install/aarch64/aarch64-linux/sys-root/ -R 0 -/= cleanup-11.exe qemu: uncaught target signal 11 (Segmentation fault) - core dumped. Actually, this caused by ABI incompatibility between Linux Kernel (trunk) and qemu-aarch64. In fact, size of siginfo structure in Linux and target_siginfo structure in qemu-aarch64 differ: sizeof (struct target_siginfo) =3D 136 // QEMU sizeof (struct siginfo) =3D 128 // Linux Kernel This caused by wrong TARGET_SI_PAD_SIZE defined in linux-user/syscall_defs= .h: #define TARGET_SI_PAD_SIZE ((TARGET_SI_MAX_SIZE/sizeof(int)) - 3) In Kernel respective value is: #define SI_PAD_SIZE ((SI_MAX_SIZE - __ARCH_SI_PREAMBLE_SIZE) / sizeof(i= nt)) ............................................. #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) // for Aarch64 Trivial fix, changing TARGET_SI_PAD_SIZE to right value, is attached. ** Affects: qemu Importance: Undecided Status: New ** Patch added: "Trivial fix." https://bugs.launchpad.net/bugs/1416988/+attachment/4310279/+files/qemu_= siginfo.diff -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1416988 Title: Wrong signal handling in qemu-aarch64. Status in QEMU: New Bug description: Running GCC 5.0 testsuite under qemu-aarch64, I noticed that tests connected with stack unwinding fail with: qemu: uncaught target signal 11 (Segmentation fault) - core dumped or run into infinite loop. Here is one example: $ /home/max/build/gcc-aarch64/gcc/xgcc -B/home/max/build/gcc- aarch64/gcc/ /home/max/src/toolchain/gcc/gcc/testsuite/gcc.dg/cleanup-11.c -fexceptions -fnon-call-exceptions -O2 -lm -o ./cleanup-11.exe $ qemu-aarch64 -L /home/max/install/aarch64/aarch64-linux/sys-root/ -R 0 = -/cleanup-11.exe qemu: uncaught target signal 11 (Segmentation fault) - core dumped. Actually, this caused by ABI incompatibility between Linux Kernel (trunk) and qemu-aarch64. In fact, size of siginfo structure in Linux and target_siginfo structure in qemu-aarch64 differ: sizeof (struct target_siginfo) =3D 136 // QEMU sizeof (struct siginfo) =3D 128 // Linux Kernel = This caused by wrong TARGET_SI_PAD_SIZE defined in linux-user/syscall_de= fs.h: #define TARGET_SI_PAD_SIZE ((TARGET_SI_MAX_SIZE/sizeof(int)) - 3) In Kernel respective value is: #define SI_PAD_SIZE ((SI_MAX_SIZE - __ARCH_SI_PREAMBLE_SIZE) / sizeof= (int)) ............................................. #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) // for Aarch64 Trivial fix, changing TARGET_SI_PAD_SIZE to right value, is attached. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1416988/+subscriptions