Re: signal(SIGFPE,SIG_IGN) causes endless loop (fwd)

Jim Nance (Jim_Nance@avanticorp.com)
Tue, 23 Apr 1996 06:47:51 -0400 (EDT)


Forwarded message:
>

> > > int main()
> > > {
> > > int a,b,c;
> > >
> > > signal(SIGFPE,SIG_IGN);
> > > a = 1;
> > > b = 0;
> > > c = a/b;
> > > return 0;
> > > }
> >
> > In case anyone cares, this program runs to completion under both Digital Unix
> > and SunOS. The result of c after the division is 0 on both platforms.
> >
> It dumps core on Solaris 2.4 with the message:
> Floating exception (core dumped).

That is probably the correct thing to do. Does it seem strange to anyone
that an integer divison problem causes a floating point exception?

Oh, I just tested HP-UX 9.03. It seems to do the same thing as Linux.
At least as far as I can tell. I don't know how to use the debugger on
HP-UX, so all I can say is that the program never finishes, and can not
be interupted by a cntrl-C. It can be suspended with a cntrl-Z.

Jim