From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60806 invoked by alias); 9 Jul 2018 15:47:20 -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 60400 invoked by uid 89); 9 Jul 2018 15:47:19 -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= X-HELO: nihcesxway6.hub.nih.gov Received: from nihcesxway6.hub.nih.gov (HELO nihcesxway6.hub.nih.gov) (128.231.90.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Jul 2018 15:47:18 +0000 Received: from uccbx04.nih.gov (HELO ces.nih.gov) ([156.40.79.154]) by nihcesxway6.hub.nih.gov with ESMTP; 09 Jul 2018 11:47:16 -0400 Received: from uccbX03.nih.gov (156.40.79.153) by uccbx04.nih.gov (156.40.79.154) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 9 Jul 2018 11:47:16 -0400 Received: from GCC01-CY1-obe.outbound.protection.outlook.com (156.40.79.134) by uccbX03.nih.gov (156.40.79.153) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Mon, 9 Jul 2018 11:47:15 -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=KyN3ydwNFazxcycKOSJkEoUs22wQh7VqZINIu6QNPq0=; b=lMDhzVjC9tMIY2rWsB/bt0ss/MNd6zUN3zetSrzFc6pDDNotA0QkRcXVrZ1pIVvVnAQQJYrthAorlfnHUf1HUsqSbZ19uiO1lcWwMAUzGk7EaAxZly8RHMXtyR0xppvsa9WyaS33XdRzRG/eOFDiGr1PdXz2nhbFppSqoYIQLHM= Received: from CY4PR09MB1302.namprd09.prod.outlook.com (10.172.66.140) by CY4PR09MB1302.namprd09.prod.outlook.com (10.172.66.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.21; Mon, 9 Jul 2018 15:47:14 +0000 Received: from CY4PR09MB1302.namprd09.prod.outlook.com ([fe80::e49a:642b:ceb:3e7e]) by CY4PR09MB1302.namprd09.prod.outlook.com ([fe80::e49a:642b:ceb:3e7e%2]) with mapi id 15.20.0930.016; Mon, 9 Jul 2018 15:47:14 +0000 From: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" To: "'cygwin@cygwin.com'" Subject: FPE in localtime.cc Date: Mon, 09 Jul 2018 15:47: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-07/txt/msg00081.txt.bz2 Hello, the following sample coredumps with FPE at localhost.cc:1962 with the lates= t snapshot (6/29/2018): #define _GNU_SOURCE #include #include #include static time_t s_Time; static void fun(void) { char buf[40]; strftime(buf, sizeof(buf), "%m/%d/%y %H:%M:%S", localtime(&s_Time)); printf("%s\n", buf); } int main() { feenableexcept(FE_ALL_EXCEPT); time(&s_Time); fun(); } $ cat a.exe.stackdump Exception: STATUS_FLOAT_INEXACT_RESULT at rip=3D001800BBA24 rax=3D000000000000016D rbx=3D000000005B43498E rcx=3D00000000000001EC rdx=3D1845C8A0CE512957 rsi=3D0000000051EB851F rdi=3D2CC3D8D4A245F203 r8 =3D0000000000F92B80 r9 =3D00000000FFFFFFED r10=3D00000000000007E2 r11=3D000000000000000C r12=3D00000000FFFFFFFF r13=3D0000000080000000 r14=3D00000000000000BD r15=3D00000000000007E2 rbp=3D000000007FFFFFFF rsp=3D00000000FFFFCA70 program=3DC:\Cygwin64\...\a.exe, pid 14232, thread main cs=3D0033 ds=3D002B es=3D002B fs=3D0053 gs=3D002B ss=3D002B Removing the first line of the main() function lets the program run success= fully. The same code runs fine unmodified on Linux. $ gcc -Wall sample.c -lm $ ./a.out 07/09/18 11:44:26 Any ideas? Thanks, Anton Lavrentiev -- 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