delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
DomainKey-Signature: | a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:date:from:to:subject:message-id:reply-to | |
:references:mime-version:content-type:in-reply-to; q=dns; s= | |
default; b=b65ycBsuxseSbR3jBzcHbLQPvLJQidox6o07WXKCUAaA1Vf2hw7Bw | |
cnKgHTsdf9RuYgNS6tp42OfvMlx/Xr7RtTJDolQl6BH4yyohljyaq4itko1ABf0q | |
6Lg8qmUwysl37oX+3FaUqKaqQY6Q6igPNg4y4cHAf03oHuO7+i8FXk= | |
DKIM-Signature: | v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:date:from:to:subject:message-id:reply-to | |
:references:mime-version:content-type:in-reply-to; s=default; | |
bh=ZShCMR3wsqlXd+8kKVnzWNshk60=; b=CwsHuGMeeowHBUrjE0tlxdzL8cKA | |
aLLRcdio9ygrugl/Voi43yqf/90xGzuI5Qg7CoS5X+L4YqNwSIGGSIXVT263/aoC | |
PzspVXQ1JUCZ8yuTvdHm9kSPUi9vL3lsAFdxxxPNw4mq9pMNucW/reBpqsRuMC1w | |
8RoxjZskUIxDjsE= | |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
Authentication-Results: | sourceware.org; auth=none |
X-Spam-SWARE-Status: | No, score=-101.3 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= |
X-HELO: | mout.kundenserver.de |
Date: | Tue, 26 Jun 2018 10:14:09 +0200 |
From: | Corinna Vinschen <corinna-cygwin AT cygwin DOT com> |
To: | cygwin AT cygwin DOT com |
Subject: | Re: FPE_FLTSUB where FLT_FLTINV is expected |
Message-ID: | <20180626081409.GO28757@calimero.vinschen.de> |
Reply-To: | cygwin AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
References: | <CY4PR09MB13023B702E15095F7217A729A54A0 AT CY4PR09MB1302 DOT namprd09 DOT prod DOT outlook DOT com> |
MIME-Version: | 1.0 |
In-Reply-To: | <CY4PR09MB13023B702E15095F7217A729A54A0@CY4PR09MB1302.namprd09.prod.outlook.com> |
User-Agent: | Mutt/1.9.2 (2017-12-15) |
--M0YLxmUXciMpOLPE Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Jun 25 20:51, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote: > Hello, >=20 > The following code produces FPE_FLTSUB(22) for the signal code whereas al= l platforms (Linux, Mac, FreeBSD) where I tested it, consistently yield FPE= _FLTINV > (which on CYGWIN has a value of 21): >=20 > #define _GNU_SOURCE > #include <fenv.h> > #include <signal.h> > #include <stdio.h> > #include <string.h> > #include <unistd.h> >=20 > void sigfpe(int signo, siginfo_t* si, void* ucontext) > { > printf("code =3D %d\n", si->si_code); > _exit(255); > } >=20 > int main() > { > double a =3D 0, b =3D 0; > struct sigaction sa; > memset(&sa, 0, sizeof(sa)); > sa.sa_sigaction =3D sigfpe; > sa.sa_flags =3D SA_SIGINFO; > sigaction(SIGFPE, &sa, 0); > feenableexcept(FE_ALL_EXCEPT); > printf("%lf", a / b); > return 0; > } >=20 > I suppose that this block of code in exceptions.cc is not particularly co= rrect, and only the last case (STACK_CHECK) actually pertains to the FLTSUB= situation, > while all previous labels should be redirected to FPE_FLTINV (which, BTW,= seems not being used at all in CYGWIN): >=20 > case STATUS_FLOAT_DENORMAL_OPERAND: > case STATUS_FLOAT_DIVIDE_BY_ZERO: > case STATUS_FLOAT_INVALID_OPERATION: > case STATUS_FLOAT_STACK_CHECK: > si.si_signo =3D SIGFPE; > si.si_code =3D FPE_FLTSUB; > break; >=20 > Thanks for looking into this! Thanks for the testcase! I pushed a patch. Expect new devloper snapshots on https://cygwin.com/snapshots later today. Thanks, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --M0YLxmUXciMpOLPE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlsx9dEACgkQ9TYGna5E T6D/Zg/+NG0MnbyW+xOrQDYfbSb5z8qxS71JE8tL0cyYqnSfwZfNoLGYrj0sS8A+ LXzR0tbK8dWDtXG5O8FXoFO3yAz8BIQmsCmgrHeEa3nOoCbrdlwiKLC37KQT1tJ/ Zx8SmSgGOoAXEPVQWq1mFtbm4ZlekLVjQRXLjwR8CGRJ2slpdfUZQ8Tt+RhvnKxR MOqirON5JQmeOtN+E30gApt2vLbgyM7HFQeVTwJeu8YxvAyWdlg2MSrinA0bWYXm BBFM2wXXz2H14To2S4WwN21inXRwf11N5voECDERJwSYcw8hxThkdHhcYF/XUa0O 2HQJ8OerakI6Xp6sTsriZK0AS78++0GfgeLDVm1plELWbvkx0Lqdgz4ZdcZpADcm 8iPF+cg7nVGnLAcXxyd6X5Q78YNkfBbIRH/FgBhPGnDbMHh7wHvXms3bO5tT3wMy 3sgbOMyG7cPogRdi/lJv09qAZDZdMF83SEmK/O5Ia+LuPpinDQCyP47LyRO8oXlR Ys7q8bhigChOfOYcasaQ87nEHXyrLNY0wUvpfyWrSJTzyVXmi95lSgiLYnCeiGpS 56opw2f27/Uj7m4LDBNqJU/n69JjntFA8Xd3nTuHyd2ZrrxtLKQkVpceLka8yXJC NHOAWhaste77l1SrvEXwnwfEEyUEqki1sZW3EI+l1NZ9FX4MfgM= =fa19 -----END PGP SIGNATURE----- --M0YLxmUXciMpOLPE--
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |