delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/13/21:14:43

Sender: nate AT cartsys DOT com
Message-ID: <364CE415.DB9AAFD0@cartsys.com>
Date: Fri, 13 Nov 1998 17:59:49 -0800
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.05 [en] (X11; I; Linux 2.0.35 i486)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
CC: Cesar Scarpini Rabak <csrabak AT ipt DOT br>
Subject: Re: DJGPP tools and utilities SIGFPE'ng after Floating Exception
References: <Pine DOT SUN DOT 3 DOT 91 DOT 981111165804 DOT 5508E-100000 AT is>
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii wrote:
> 
> On Wed, 11 Nov 1998, Cesar Scarpini Rabak wrote:
> 
> > I noticed make version 3.77 and rm from fileutils 3.16 exit with a SIGFPE
> > just after a fortran (g77 version 0.5.23) program had aborted with a
> > "Floating Exception".
> 
> This is a known problem in some environments.  The DJGPP startup code
> doesn't clear the FPU and leaves the Invalid exception unmasked.  So when
> a previous program left the FPU in a mess, and the OS didn't clean up (I
> think Windows is sloppy in this regard), the next program crashes during
> startup.
> 
> v2.02 will mask all FP exceptions, so it probably won't suffer from this
> too much.  But IMHO the real problem is in your Fortran program that
> crashed with SIGFPE in the first place: it should have caught the signal
> and call _clear87 (or even _fpreset) before it exits.  Running FP programs
> on Windows and not cleaning up in case of SIGFPE is like throwing stones
> in a glass house...
> 
> Personally, I have a small proggy that calls _clear87 and _fpreset, and I
> always run it after a program crashes with SIGFPE.

Now, it seems to me I've asked this before, but I've forgotten the
answer.  Why don't we reset the FPU at startup, shutdown, or in the
default SIGFPR handler?
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019