From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Cygwin bash's built-in test command crashes on Windows 2008 Server 64bit under KVM Date: Sat, 14 Feb 2009 00:06:26 +0200 Message-ID: <4995EEE2.5090600@redhat.com> References: <40ddf2480901050654y268213d1jbf34f9d81d6faeb0@mail.gmail.com> <40ddf2480901050822q52a9c2b6x5d5d87d17dec4992@mail.gmail.com> <49788A80.2070403@redhat.com> <87bptgnykd.fsf@fftw.org> <4995D180.9000706@redhat.com> <878woaozu2.fsf@matteo.cilk.lan> <4995D7FD.9020609@redhat.com> <87eiy26ph9.fsf@cilk.com> <4995DFD6.7050605@redhat.com> <87ab8q6ngc.fsf@cilk.com> <4995EA51.20805@redhat.com> <8763je6m8i.fsf@cilk.com> <87y6wa57j2.fsf@cilk.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Matteo Frigo Return-path: Received: from mx2.redhat.com ([66.187.237.31]:53523 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753223AbZBMWGJ (ORCPT ); Fri, 13 Feb 2009 17:06:09 -0500 In-Reply-To: <87y6wa57j2.fsf@cilk.com> Sender: kvm-owner@vger.kernel.org List-ID: Matteo Frigo wrote: > Matteo Frigo writes: > > >> Avi Kivity writes: >> >> >>> Can you run the slightly modified gs.c (attached) and rerun on AMD? >>> The is to see if the runtime somehow restores gs. >>> >> Crashes as follows: >> >> w2k3-64:~$ ./a.exe >> gs: 2b >> gs:0x30: 7efdb000 >> Segmentation fault (core dumped) >> > > A little bit more information: > > w2k3-64:~$ gdb a.exe > GNU gdb 6.8.0.20080328-cvs (cygwin-special) > Copyright (C) 2008 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. Type "show copying" > and "show warranty" for details. > This GDB was configured as "i686-pc-cygwin"... > (no debugging symbols found) > (gdb) r > Starting program: /home/athena/a.exe > [New thread 1620.0x6dc] > Error: dll starting at 0x77d40000 not found. > Error: dll starting at 0x77d40000 not found. > Error: dll starting at 0x77c20000 not found. > Error while mapping shared library sections: > /cygdrive/c/WINDOWS/SysWOW64/ntdll32.dll: No such file or directory. > (no debugging symbols found) > (no debugging symbols found) > (no debugging symbols found) > (no debugging symbols found) > (no debugging symbols found) > [New thread 1620.0x74c] > (no debugging symbols found) > (no debugging symbols found) > (no debugging symbols found) > > Program received signal SIGSEGV, Segmentation fault. > 0x0040109d in main () > (gdb) x/i $pc > 0x40109d : mov %gs:0x30,%esi > (gdb) p/x $gs > $1 = 0x2b > (gdb) > Okay, at least this makes some little bit of sense. On both Intel and AMD, 'mov gs' clobbers gs.base as expected. On AMD, something further down the line (some syscall likely) restores gs.base, but on Intel it doesn't. When we avoid the syscall, we get a crash on AMD as well. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.