From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HD6sW-0001HV-Ek for qemu-devel@nongnu.org; Fri, 02 Feb 2007 17:27:32 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HD6sU-0001Ec-VS for qemu-devel@nongnu.org; Fri, 02 Feb 2007 17:27:32 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HD6sU-0001EF-PM for qemu-devel@nongnu.org; Fri, 02 Feb 2007 17:27:30 -0500 Received: from an-out-0708.google.com ([209.85.132.248]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HD6sU-0006Pz-GU for qemu-devel@nongnu.org; Fri, 02 Feb 2007 17:27:30 -0500 Received: by an-out-0708.google.com with SMTP id d40so1324500and for ; Fri, 02 Feb 2007 14:27:29 -0800 (PST) Message-ID: Date: Fri, 2 Feb 2007 23:27:29 +0100 From: "andrzej zaborowski" Sender: balrogg@gmail.com Subject: Re: [Qemu-devel] Re: strange crash on FreeBSD-current/amd64 (pointer truncation?) In-Reply-To: <20070202214525.GA10125@saturn.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070124200019.GA36641@saturn.kn-bremen.de> <20070201200030.GA68583@saturn.kn-bremen.de> <20070202040200.GA32244@networkno.de> <20070202214525.GA10125@saturn.kn-bremen.de> Reply-To: balrogg@gmail.com, qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 02/02/07, Juergen Lock wrote: > On Fri, Feb 02, 2007 at 04:02:00AM +0000, Thiemo Seufer wrote: > > Juergen Lock wrote: > > > On Wed, Jan 24, 2007 at 09:00:19PM +0100, Juergen Lock wrote: > > > > Hi! > > > > > > > > I got a report of qemu segfaulting here on FreeBSD-current/amd64: > > > > > > > > > #0 main_loop () at /usr/ports-cvs/emulators/qemu/work/qemu-snapshot-2007-01-11_05/vl.c:6125 > > > > > 6125 env = env->next_cpu; > > > > > [New Thread 0x801e10190 (LWP 100214)] > > > > > (gdb) print env > > > > > $1 = (CPUX86State *) 0xac10000 > > > > > (gdb) print first_cpu > > > > > $2 = (CPUX86State *) 0x80ac10000 > > > > > > Ok Jung-uk Kim found the following fix: (Thanx!) > > > > > > --- qemu/cpu-exec.c.orig Wed Jan 31 16:58:03 2007 > > > +++ qemu/cpu-exec.c Wed Jan 31 17:08:11 2007 > > > @@ -226,9 +226,9 @@ > > > > > > int cpu_exec(CPUState *env1) > > > { > > > - int saved_T0, saved_T1; > > > + long saved_T0, saved_T1; > > > #if defined(reg_T2) > > > - int saved_T2; > > > + long saved_T2; > > > > I used target_ulong instead. > > Isn't that 32 bit for 32 bit targets? Then it wouldn't fix the bug, Well, it just happens that target_ulong is 64 bit even for 32 bit target on a 64 bit host (as a workaround for something I think, was wondering about it too. I asked on IRC once but no one knew the actual reason). This however doesn't change the fact that target_ulong shouldn't be used here. Regards, Andrew