delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/11/10:15:46

Date: Wed, 11 Nov 1998 17:08:32 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Cesar Scarpini Rabak <csrabak AT ipt DOT br>
cc: djgpp AT delorie DOT com
Subject: Re: DJGPP tools and utilities SIGFPE'ng after Floating Exception
In-Reply-To: <3.0.3.32.19981111084939.006b14d0@dce03.ipt.br>
Message-ID: <Pine.SUN.3.91.981111165804.5508E-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

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.

- Raw text -


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