From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matteo Frigo Subject: Re: Cygwin bash's built-in test command crashes on Windows 2008 Server 64bit under KVM Date: Fri, 13 Feb 2009 16:23:15 -0500 Message-ID: <87ab8q6ngc.fsf@cilk.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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from 75-150-79-137-NewEngland.hfc.comcastbusiness.net ([75.150.79.137]:45441 "EHLO cilk50.cilki.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752156AbZBMVXR (ORCPT ); Fri, 13 Feb 2009 16:23:17 -0500 In-Reply-To: <4995DFD6.7050605@redhat.com> (Avi Kivity's message of "Fri\, 13 Feb 2009 23\:02\:14 +0200") Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity writes: > More questions: > - is the bad 'mov gs' instruction reached on AMD? or is it avoided > somehow? What about bare metal? The instruction is indeed reached on amd, and gs is 0x2b after the instruction. I don't know about bare metal. > - does the attached program fail when compiled and run in cygwin on an > AMD host? The program runs as follows: w2k3-64:/cygdrive/v$ gcc -O gs.c w2k3-64:/cygdrive/v$ ./a.exe gs: 2b gs:0x30: 7efdb000 test > - does setjmp()/longjmp() come from the Windows run-time library, or > from cygwin? The setjmp()/longjmp() is in the cygwin library /bin/cygwin1.dll . bash calls longjmp() at the end of the expr built-in, which causes the problem reported by the original poster. I should also mention that, as an experiment, I have replaced the mov gs,ax instruction with a couple of no-ops in cygwin1.dll, and cygwin runs fine on Intel with this patch. Regards, Matteo Frigo