Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Wed, 2 Mar 2005 19:58:50 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: loading of wsock32 disturbs FPU Message-ID: <20050303005850.GA28410@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com References: <200503021306 DOT 32969 DOT r DOT schulz AT dkfz DOT de> <20050302143149 DOT GA3187 AT cygbert DOT vinschen DOT de> <20050302143742 DOT GZ18314 AT cygbert DOT vinschen DOT de> <20050302163239 DOT GA21977 AT trixie DOT casa DOT cgf DOT cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050302163239.GA21977@trixie.casa.cgf.cx> User-Agent: Mutt/1.4.1i On Wed, Mar 02, 2005 at 11:32:39AM -0500, Christopher Faylor wrote: >On Wed, Mar 02, 2005 at 03:37:42PM +0100, Corinna Vinschen wrote: >>On Mar 2 15:31, Corinna Vinschen wrote: >>>On Mar 2 13:33, Dave Korn wrote: >>>>Hm. We probably need to put a finit instruction into the autoload code >>>>somewhere. wsock_init () looks like just the place...... now if I >>>>just persuade the CVS code to build without a SIG11 (grmbl grmbl....) >>> >>>Hmm? -v please. >> >>I just added an finit call to wsock_init and it seems to work fine. >> >>Are there any non-FPU CPUs >= i386 out there which would choke on this >>machine instruction? I guess not, but I'm not exactly fluent in ix86 >>history... > >I mentioned to Corinna on irc that I don't think that just calling finit >is the right way to handle this. What if someone had already set the >precision as they liked? Then loading winsock would reset it. I've checked in a patch to cygwin which saves and restores the FPU control register around calls to LoadLibrary. That seems to solve the problem. I initially couldn't duplicate this FPU problem on my nifty hyperthreading system. Since Corinna verified that she could duplicate the problem, I spent way too long trying to figure out why it wasn't a problem for me. The reason it worked for me was because a cygwin thread was calling closesocket before main() was every reached, causing winsock to be loaded for no good reason. I was irritated to discover that I inadvertently added a dependence on winsock to every cygwin program in 1.5.13 when I fixed the problem with handle leakage with select in multi-threaded programs. This irritates me enough that I'll probably release a 1.5.14 with a fix soon. I'm generating a new snapshot now. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/