From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 39450 invoked by alias); 25 Jun 2018 20:52:12 -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 39438 invoked by uid 89); 25 Jun 2018 20:52:11 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 spammy=contractor, H*MI:outlook, Contractor, H*MI:prod X-HELO: nihcesxway2.hub.nih.gov Received: from nihcesxway2.hub.nih.gov (HELO nihcesxway2.hub.nih.gov) (128.231.90.124) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 25 Jun 2018 20:52:10 +0000 Received: from uccbx01.nih.gov (HELO ces.nih.gov) ([156.40.79.151]) by nihcesxway2.hub.nih.gov with ESMTP; 25 Jun 2018 16:51:55 -0400 Received: from uccbx04.nih.gov (156.40.79.154) by uccbX01.nih.gov (156.40.79.151) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 25 Jun 2018 16:51:54 -0400 Received: from GCC01-DM2-obe.outbound.protection.outlook.com (156.40.79.134) by uccbx04.nih.gov (156.40.79.154) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Mon, 25 Jun 2018 16:51:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nih.onmicrosoft.com; s=selector1-ncbi-nlm-nih-gov; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LrwA6IRB0/ysTIJN8VOAi8ISJATOfe+NX5LiqarKONg=; b=UJYnKZBgYvDRJsiWE36KGDhnd1rbEx53bBayPIDjHvNn0WAG5LaNwWH74ZSnzHr1y7vLeWUHuF86vvCrRQWDdYCsdKPacq845ZI7DKn5N1PfO9FNWkYZ6l/i3Z2MuuoeRLVqkk6n3FOZvE5oJwQjhgrS5DYbV7lAKNuAaaLG3GA= Received: from CY4PR09MB1302.namprd09.prod.outlook.com (10.172.66.140) by CY4PR09MB1303.namprd09.prod.outlook.com (10.172.66.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.22; Mon, 25 Jun 2018 20:51:53 +0000 Received: from CY4PR09MB1302.namprd09.prod.outlook.com ([fe80::7d21:624a:151d:371a]) by CY4PR09MB1302.namprd09.prod.outlook.com ([fe80::7d21:624a:151d:371a%10]) with mapi id 15.20.0884.024; Mon, 25 Jun 2018 20:51:53 +0000 From: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" To: "cygwin@cygwin.com" Subject: FPE_FLTSUB where FLT_FLTINV is expected Date: Tue, 26 Jun 2018 10:33:00 -0000 Message-ID: authentication-results: spf=none (sender IP is ) smtp.mailfrom=lavr@ncbi.nlm.nih.gov; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Return-Path: lavr@ncbi.nlm.nih.gov X-SW-Source: 2018-06/txt/msg00284.txt.bz2 Hello, The following code produces FPE_FLTSUB(22) for the signal code whereas all = platforms (Linux, Mac, FreeBSD) where I tested it, consistently yield FPE_F= LTINV (which on CYGWIN has a value of 21): #define _GNU_SOURCE #include #include #include #include #include void sigfpe(int signo, siginfo_t* si, void* ucontext) { printf("code =3D %d\n", si->si_code); _exit(255); } 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; } I suppose that this block of code in exceptions.cc is not particularly corr= ect, and only the last case (STACK_CHECK) actually pertains to the FLTSUB s= ituation, while all previous labels should be redirected to FPE_FLTINV (which, BTW, s= eems not being used at all in CYGWIN): 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; Thanks for looking into this! Regards, Anton Lavrentiev Contractor NIH/NLM/NCBI -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple