From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Njz0t-0003BM-GW for qemu-devel@nongnu.org; Tue, 23 Feb 2010 12:57:39 -0500 Received: from [199.232.76.173] (port=50359 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Njz0s-0003BA-DG for qemu-devel@nongnu.org; Tue, 23 Feb 2010 12:57:38 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Njz0p-00024w-RU for qemu-devel@nongnu.org; Tue, 23 Feb 2010 12:57:37 -0500 Received: from mail-bw0-f218.google.com ([209.85.218.218]:47923) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Njz0n-00023j-MD for qemu-devel@nongnu.org; Tue, 23 Feb 2010 12:57:35 -0500 Received: by bwz10 with SMTP id 10so2840958bwz.2 for ; Tue, 23 Feb 2010 09:57:24 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <4B840A59.3060407@aurel32.net> References: <4B840A59.3060407@aurel32.net> Date: Tue, 23 Feb 2010 17:57:23 +0000 Message-ID: Subject: Re: [Qemu-devel] gcc 4.4 miscompiling cpu_exec() ? From: Jay Foad Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: qemu-devel@nongnu.org On 23 February 2010 17:03, Aurelien Jarno wrote: > Jay Foad a =E9crit : >> I'm building QEMU mipsel-linux-user with Ubuntu's GCC 4.4 on an x86 >> host. Whenever I try to run a trivial MIPS executable, QEMU segfaults >> in cpu_loop() shortly after the call to cpu_mips_exec(). >> >> The problem seems to be that cpu_exec() doesn't preserve ebp. It tries t= o: >> >> =A0 =A0 saved_env_reg =3D (host_reg_t) env; >> >> where env is a global variable decorated with asm("ebp"). This saves >> ebp to the stack, but later on, in some function inlined into >> cpu_exec(), the value on the stack gets overwritten with something >> else. >> >> Has anyone else seen this? >> > > Yes, but only in qemu 0.12.0 to 0.12.1. The issue should be fixed in the > stable branch and in head. I'm seeing it today, with sources from git: git://git.qemu.org/qemu.git commit 724c689357211cb929c9b957e1556f211d2b56db Thanks, Jay.