Mail Archives: djgpp/1998/11/11/10:15:46
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 -