From: Chuck Ebbert <cebbert@redhat.com>
To: Clark Cooper <clark.cooper@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: PROBLEM: Caught SIGFPE exceptions aren't reset
Date: Wed, 29 Aug 2007 15:13:22 -0400 [thread overview]
Message-ID: <46D5C552.1060307@redhat.com> (raw)
In-Reply-To: <e21d91280708251031k5e3bd962o6a268e6506696a8c@mail.gmail.com>
On 08/25/2007 01:31 PM, Clark Cooper wrote:
>> 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).
>
> Given the current SIGFPE handling in the kernel, a userland handler
> CAN'T mask the exceptions or clear the exception flags. This is
> demonstrated in my example program where I call both feclearexception
> and fedisableexception in the handler. The reason these don't work is
> that any change you make to these FPU registers is overwritten with
> the saved FPU context on return from the signal handler. Changing the
> PC won't help since the exception flag is still set and unmasked on
> signal return.
Just change the saved FPU context before returning. (It's on the stack
when your handler is running.)
prev parent reply other threads:[~2007-08-29 19:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-25 4:40 PROBLEM: Caught SIGFPE exceptions aren't reset Clark Cooper
2007-08-25 10:15 ` Mikael Pettersson
[not found] ` <e21d91280708251018l4904b6bcm5b40e22b6b2cbedc@mail.gmail.com>
2007-08-25 17:31 ` Clark Cooper
2007-08-29 19:13 ` Chuck Ebbert [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46D5C552.1060307@redhat.com \
--to=cebbert@redhat.com \
--cc=clark.cooper@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.