From: Anton Blanchard <anton@samba.org>
To: Daniel Barlow <dan@telent.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.4, arch-dependent floating point exception and trap handling
Date: Wed, 31 Jul 2002 22:47:15 +1000 [thread overview]
Message-ID: <20020731124714.GB21246@krispykreme> (raw)
In-Reply-To: <873cu1nz4e.fsf@noetbook.telent.net>
Hi,
> I'm seeing discrepancies between the way that floating point
> exceptions are handled on different architectures. Briefly, I have a
> program that uses the glibc function feenableexcept() to enable SIGFPE
> on divide-by-zero errors, then installs a SIGFPE handler that uses
> sigsetjmp/siglongjmp, then divides 1.0 by 0.0 twice.
>
> What I expect to happen is for my signal handler to be called twice.
> What actually happens varies:
...
> my signal handler is called the first time, and then the second
> attempt gets "inf". I've run this under gdb as well; the second SIGFPE is
> not received by the process
The x86 like behaviour happens on ppc64 too:
exceptions enabled: 0
exceptions enabled: 4000000
hello
in handler
abort
a/b=inf
terminating
There is a reason for this. A signal handler might want to do floating
point so exceptions are disabled upon entering a signal handler.
Now the question that needs to be answered is whether sigsetjmp should
save the floating point exception register. I asked our resident
standards expert Chris Yeoh and the answer is no.
So the x86, ppc32 and ppc64 behaviour looks correct.
Anton
prev parent reply other threads:[~2002-07-31 12:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-30 13:06 Daniel Barlow
2002-07-31 12:47 ` Anton Blanchard [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=20020731124714.GB21246@krispykreme \
--to=anton@samba.org \
--cc=dan@telent.net \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®