Re: signal(SIGFPE,SIG_IGN) causes endless loop

Ulrich Windl (Ulrich.Windl@rz.uni-regensburg.de)
Mon, 22 Apr 1996 11:16:58 +0200


On 21 Apr 96 at 19:01, Thomas Koenig wrote:

> In linux.dev.kernel, Linus Torvalds <torvalds@cs.helsinki.fi> wrote:
> > - it's stupid. What is the result of a division with 0? For FP errors,
> > there are reasonable things we can do (+-Inf), but for integer
> > division by zero the result is undefined. Allowing the program to just
> > "continue" as if nothing happened without letting it handle signals is
> > the _wrong_ thing to do.
>
>
> There are quite a number of reasonable situations, for example image
> processing, where I might want to ignore an error like that, and don't
> care what the result is (which might show up as a single pixel in error,
> which is no big deal, and also can happen in 69 other ways).
>
> If I write 'ignore this kind of thing', I mean it. I don't think the
> kernel should set policy here.

Maybe it's a probem with the CPU: There should be a status flag to
ignore creating that exception. (I think in VAX assembler you can do
it that way).

>
> I could live with SIGFPE not being ignorable, if I get IEEE behaviour
> for floats. Having the program go into an endless loop is... rude
> at least, and very highly frustrating. Have you ever sent off a program
> which runs for days, and which then goes into an endless loop after
> ten seconds?