From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id BEDA43858CDA; Tue, 31 Oct 2023 12:31:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BEDA43858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1698755514; bh=amspY/OieVRMGn+0Zmn2dT2Y9xL9hxS7iT4Go/3fxbo=; h=From:To:Subject:Date:From; b=tvurxl0BUXtmF/WbtURYJ0q2sM7GpseIqQN9LlMdgkF4ORKTvyTLJTy2Xn7pHoHNk nvf6y96hZg7tkJ6iv2saa7VJGbaQ9bP+ryVUl0ZhbpRM11GKU2jW0iL9kyL4mpoYiE K2pY7vuB5fTf0KLWUG5FPv0rLexpMkWBUxfbgWx8= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/cygwin-3_4-branch] Cygwin: let feraiseexcept actually raise an exception X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/cygwin-3_4-branch X-Git-Oldrev: f0c90d3a8aa4409608abe76e035eab5919133a61 X-Git-Newrev: 97a975dac2dee9640964f54fa9693f0295c2363c Message-Id: <20231031123154.BEDA43858CDA@sourceware.org> Date: Tue, 31 Oct 2023 12:31:54 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D97a975dac2d= ee9640964f54fa9693f0295c2363c commit 97a975dac2dee9640964f54fa9693f0295c2363c Author: Corinna Vinschen AuthorDate: Tue Oct 31 13:07:36 2023 +0100 Commit: Corinna Vinschen CommitDate: Tue Oct 31 13:29:15 2023 +0100 Cygwin: let feraiseexcept actually raise an exception =20 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). =20 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. =20 Fix this by moving feraiseexcept into the NOSIGFE realm. =20 Fixes: 0f81b5d4bcaa ("* Makefile.in (DLL_OFILES): Add new fenv.o module= .") Signed-off-by: Corinna Vinschen 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 be404263e605..c70380fe83fb 100644 --- a/winsup/cygwin/cygwin.din +++ b/winsup/cygwin/cygwin.din @@ -532,7 +532,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 =20 - 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