Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/regress/lib/libc/siginfo/sigfpe



christos%zoulas.com@localhost said:
> This all started because if the SIGFPE's in a tight loop froze the
> vax.

Ah yes, I see mhitch's mail.

> Programming with setjmp and longjmp is very difficult and
> requires a lot of discipline to deal with memory allocation.

Agreed. But the SIGFPE case is somewhat special. A program
doing real numerical computations wouldn't be able to continue
after a fpe signal in a useful way - it will abort or start
over with changed parameters.
What we have to deal with are kind of meta-programs as
regression tests, interpreters, or lint(1) which is also
an interpreter at that point. Here we know at which
points suspicious code is executed, and can make sure
that the signal handler is only invoked where we allow.

I haven't seen any portable code which tries to return
from a SIGFPE by just a "return". In particular Python which
is certainly exercised a lot in different environments
does a longjmp from its sigfpe handler.

So I'd suggest to make lint(1) more conservative, which
should not be that hard because everything happens just
in the foldflt() function -- either do some setjmp/longjmp
just in this function, or just test the sticky flags
which would avoid signals completely.

> I just want to add the ability to do/control this in all archs in a sane
> way.

I think this is a game we can't win. As Joerg said it might require
opcode interpretation in the kernel trap handler. Look at
the alpha fp completion code...

best regards
Matthias




-------------------------------------------------------------------
-------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich

Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr. Harald Bolt,
Dr. Sebastian M. Schmidt
-------------------------------------------------------------------
-------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index