Re: PROBLEM: Caught SIGFPE exceptions aren't reset



Clark Cooper writes:
[1] Caught SIGFPE exceptions aren't reset

[2]
On an i386, you can set a handler for a SIGFPE signal, and after enabling FP
exceptions with feenableexceptions(), an FP exception will cause
your handler
to be called. However after the handler returns, it is called
again with the
same FP error. Control never returns to the point after the
instruction that
caused the exception.

User error.

You cannot write working SIGFPE handlers without understanding the
underlying FP instruction set and its exception model, and being
prepared to write CPU- and OS-specific code.

In particular, on modern x86, an SSE2 FP instruction that raises
an exception will be set to restart in the resumption state.
It's up to your handler to either bypass the restart (longjmp),
or to update the resumption state so that it can be resumed without
triggering an infinite loop. Your handler can do this by masking
exceptions, changing the operands of the failed FP instruction,
or by changing the PC so that the failed instruction is skipped
(your handler may want to emulate the instruction in this case).

This is not a kernel problem.

/Mikael
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Try Finally...
    ... Now we can protect every more or less specialized action ... an error indication (exception or error code) has to be ... an according exception handler can be inserted into the code. ... resources, as they are related to specific actions. ...
    (comp.lang.pascal.delphi.misc)
  • Re: WinForms bug? ThreadException not invoked on Exceptions in system code pre-processing the me
    ... Message Queue and invoking the appropriate handler. ... if an Exception is raised during the PRE-PROCESSING of a Windows ... And because any handling will probably fail if there is no memory, the CLR will terminate the application without attempting to call the ApplicationException or UnhandledException events. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: BackgroungWork taske ended for no appearent reason
    ... To do the same thing with Try/Catch blocks requires wrapping every file access with a Do While ... ... If there was any exception thrown in your DoWork event handler, ... If the operation raises an exception that your code does not handle, ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Frame-based exception handling problem on Server 2008
    ... In this case, the exception ends fatal, usually Cygwin creates a stack ... The Cygwin DLL is a POSIX ... handler is supposed to be *the* exception handler for Cygwin ... It also does not know if the signal handler returns or not. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Frame-based exception handling problem on Server 2008
    ... If I set a breakpoint to our exception ... points to the default handler, our exception handler is called just fine. ... typedef struct _exception_list ...
    (microsoft.public.win32.programmer.kernel)