From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44882 invoked by alias); 26 Jun 2018 08:16:51 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 42454 invoked by uid 89); 26 Jun 2018 08:14:15 -0000 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 Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (212.227.17.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 26 Jun 2018 08:14:13 +0000 Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MORwj-1fU84l1y0j-005qby for ; Tue, 26 Jun 2018 10:14:10 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id C72F4A81974; Tue, 26 Jun 2018 10:14:09 +0200 (CEST) Date: Tue, 26 Jun 2018 14:18:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: FPE_FLTSUB where FLT_FLTINV is expected Message-ID: <20180626081409.GO28757@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="M0YLxmUXciMpOLPE" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-SW-Source: 2018-06/txt/msg00285.txt.bz2 --M0YLxmUXciMpOLPE Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1702 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 > #include > #include > #include > #include >=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" Content-length: 833 -----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--