public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin/main] Cygwin: let feraiseexcept actually raise an exception
Date: Tue, 31 Oct 2023 12:31:59 +0000 (GMT)	[thread overview]
Message-ID: <20231031123159.C73FE385841C@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=2ef627c46eb2b7cbc359088e5619be74637e9b90

commit 2ef627c46eb2b7cbc359088e5619be74637e9b90
Author:     Corinna Vinschen <corinna@vinschen.de>
AuthorDate: Tue Oct 31 13:07:36 2023 +0100
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Tue Oct 31 13:27:51 2023 +0100

    Cygwin: let feraiseexcept actually raise an exception
    
    The exception handling inside of Cygwin functions marked as SIGFE
    covers exceptions and lets the library code handle them gracefully.
    If these functions want to raise an exception, they have to send a
    signal explicitely via raise(3).
    
    That's not what we want in feraiseexcept(). It triggers a floating
    point exception explicitely by calling the i387 op "fwait".  Being
    marked as SIGFE, this exception will be suppressed and the normal
    exception handling won't kick in.
    
    Fix this by moving feraiseexcept into the NOSIGFE realm.
    
    Fixes: 0f81b5d4bcaa ("* Makefile.in (DLL_OFILES): Add new fenv.o module.")
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/cygwin.din     | 2 +-
 winsup/cygwin/release/3.4.10 | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/cygwin.din b/winsup/cygwin/cygwin.din
index 3afadb7f3a77..d5e8f8c05ef8 100644
--- a/winsup/cygwin/cygwin.din
+++ b/winsup/cygwin/cygwin.din
@@ -534,7 +534,7 @@ fegetround NOSIGFE
 feholdexcept SIGFE
 feof SIGFE
 feof_unlocked SIGFE
-feraiseexcept SIGFE
+feraiseexcept NOSIGFE
 ferror SIGFE
 ferror_unlocked SIGFE
 fesetenv SIGFE
diff --git a/winsup/cygwin/release/3.4.10 b/winsup/cygwin/release/3.4.10
index c75283991461..ec28cdf7e791 100644
--- a/winsup/cygwin/release/3.4.10
+++ b/winsup/cygwin/release/3.4.10
@@ -6,3 +6,6 @@ Bug Fixes
 
 - Fix hang in process initialization if cwd is unreadable.
   Addresses: https://cygwin.com/pipermail/cygwin/2023-October/254604.html
+
+- Let feraiseexcept actually raise an exception.
+  Addresses: https://cygwin.com/pipermail/cygwin/2023-October/254667.html

                 reply	other threads:[~2023-10-31 12:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20231031123159.C73FE385841C@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).