delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/08/29/21:22:06

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 753B9385DC39
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1598750482;
bh=vCrO9D+BRDWnKR4fNipqlopZ4KFgXfCVKDtxyMx+TYg=;
h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=fBv+FZfuqyxKI35b0wFQGQkQ/CTQyOMsmv+Rtt+Mcare0GUhWt8JFpPIYArSbU5Ij
IgC8JyKVQUEik8Evp3bPFN5mRzXqxAOTNMMJjGssy4ikNKNXg4f31WI6GJhGuEGFck
/95UhRUG5ilwiuGC9MfVfO9f5uqBp0g3IYOCCp9w=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F3D2E3857C43
X-YMail-OSG: 8UMBMl4VM1mAard3QStIBowm.J8qRo8IrPaZCsb9nIFxWDTl8zLjdroDYsy0TvH
.tHYcLgf4CKqHGtDBuRZ7e6AHMJhXydB9fn9MEAsg_lgGDsyCWwVhdGeuTqQkwYLbEJQrzhRWCOE
qi0JI0IPpIjDlU8SaPXtXci.dF._WfTe3hMHC4NI4xEADs_CLh6WJD5Qc56KBaOQIYgKC9u6s9ER
hIVrNtUA.L8ZQM0OYW.zWxZukwYNBZAjhfLSPROlmKIeR5Ibk.d6YPHOfgniOle9__hndhBsu53H
f27j8DVU96ARPa5QsSvbVsp1JpHfYMOKsL1Ybi.jnGXx54H.3j1mRZi_PhHuf..eFfoF.YaXRlWK
tVf.BWeW_9a8QBDTO.J.R5z_7oEv8Mef3o3IcELqrf2k0EQbC.qZEfw_M0wTKVrhqbCmq9Zc_nK9
J8XB8vHVJf6BHIYwrpua8gJjJbrwW1XAlzro1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fl segfaults
To: cygwin AT cygwin DOT com
References: <02b16d2e-9d51-de58-807b-3b31b2565b59 DOT ref AT aol DOT com>
<02b16d2e-9d51-de58-807b-3b31b2565b59 AT aol DOT com>
<9f819e67-5476-ea48-a13f-f7a4b25d6e69 AT cornell DOT edu>
Autocrypt: addr=airplanemath AT aol DOT com; keydata=
mQENBFtoYKMBCADCZv4MAdlySVILN4X9ugsWKmOKC80Q1RFF5gxNhbhIorAY52J2IgIeMIgK
CMogCY41C4KjNl4shSfkCJQQR8kDE4TNKhno4hmE4k8d0B4vbAZsr2qkRK11YikH/9ocyOh/
9TtNSFH6nZjSbIY8a4uViMX9MNyoZmv30B6B/OWWwUz9Yd5psVFHIolrB3H4L835GlGO6CzC
j4xEemlKTkQeJ+c2H5T1JrzKE0H06CXoKVy+VABd2I3BVyCs8cmTH50KGLj6gIk7mjLQ5Lio
L6gAzaPjJA21IG7QVR1bF7vX7/VyeS/CLEnh6k83toHlBi5QOwCA+Y22oDZ604JHA5B5ABEB
AAG0I2FpcnBsYW5lbWF0aCA8YWlycGxhbmVtYXRoQGFvbC5jb20+iQFUBBMBCAA+FiEEgfIC
b6IPSG5I5cJLx/Fa3MIKz3UFAltoYKYCGwMFCQHhM4AFCwkIBwIGFQoJCAsCBBYCAwECHgEC
F4AACgkQx/Fa3MIKz3X9JAgAvj1eQQK7i+fkPNMrtL70EXDBhg/n45xumOTom6c0m3AxmLzw
yQV0yGUWvJ9dMw7BKZTfDWx4FKfprZC+53uPbj6GIsidsVNBFdwT8NSnSxyA77y7NFvns0Sg
CDCFa9dRtA1UVuX3wx++0eBVaZUJ2D15RcMrPtJ3JgsKyyT5piSc6Y7OZ3EMyc0QbP4mhmjq
sbpUD1SDF6iD4kKj8zbkhXOAZGJigDeI1Ffim0k8q8ZURqwPOqLhanwSyyIZ2P1pC3G55TBM
5oBH1SOB4n6iGApRymE7b2NwvTECPpCBDCjwKbnFWfIt8olUuV6MnMrChCGjc6eP/zSIAFPC
kl7NtQ==
Message-ID: <12c7b933-d06e-3b92-9c50-a1c3ad353a48@aol.com>
Date: Sat, 29 Aug 2020 21:21:08 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
Thunderbird/68.12.0
MIME-Version: 1.0
In-Reply-To: <9f819e67-5476-ea48-a13f-f7a4b25d6e69@cornell.edu>
X-Mailer: WebService/1.1.16565
mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol
Apache-HttpAsyncClient/4.1.4 (Java/11.0.7)
X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_00, BODY_8BITS,
DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM,
KAM_GOODAOL, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,
SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: airplanemath via Cygwin <cygwin AT cygwin DOT com>
Reply-To: airplanemath <airplanemath AT aol DOT com>
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id 07U1LlhJ013491

On 8/29/2020 1:57 PM, Ken Brown wrote:
> On 8/29/2020 8:52 AM, airplanemath via Cygwin wrote:
>> Hello,
>>
>> I have two reports.� A brief description of the system:
>> $ uname -a | sed "s/${HOSTNAME}/\${HOSTNAME}/g"
>> CYGWIN_NT-10.0 ${HOSTNAME} 3.1.7(0.340/5/3) 2020-08-22 17:48 x86_64
>> Cygwin
>
> In the future, please use two separate emails for two unrelated bug
> reports.


Will do.

>
>> The first report:
>>
>> $ cpp /usr/include/threads.h
>> # 1 "/usr/include/threads.h"
>> # 1 "<built-in>"
>> # 1 "<command-line>"
>> # 1 "/usr/include/threads.h"
>> /usr/include/threads.h:30:10: fatal error: machine/_threads.h: No such
>> file or directory
>> ��� 30 | #include <machine/_threads.h>
>> ������ |��������� ^~~~~~~~~~~~~~~~~~~~
>> compilation terminated.
>>
>> $ cygcheck -p machine/_threads.h
>> Found 0 matches for machine/_threads.h
>
> It looks like /usr/include/threads.h is a Newlib header that's
> intended for RTEMS.� Here's the commit where it was introduced:
>
> commit c98d01ee0cbc6eb7bbca8f2cde4a46b90ded3784
> Author: Jeff Johnston
> Date:�� Tue Oct 13 17:52:34 2015 -0400
>
> ��� Import <threads.h> from latest FreeBSD.
>
> ��� - Move types and defines to
> ����� <machine/_threads.h> so that it can be customized per target.
>
> ����������� * libc/include/threads.h: New.
> ����������� * libc/sys/rtems/include/machine/_threads.h: Likewise.
>
> There's no machine/_threads.h in the repository for any platform other
> than RTEMS.�
> My guess is that it shouldn't be included in the Cygwin distro.


Okay.� I can work on convincing whatever program wanted this that the
header doesn't
exist and see what happens, assuming I can remember which program wanted
this.

>
>> The second report:
>>
>> $ cat test.c
>> #include <math.h>
>> #include <stdio.h>
>> #include <stdlib.h>
>>
>> int main(int argc, char *argv[]) {
>> �� long double a, b, c;
>> �� char *num_end = NULL;
>> �� a = b = c = 0.0L;
>> �� if (argc != 2) {
>> ���� fprintf(stderr, "Usage: %s NUMBER\n", argv[0]);
>> ���� exit(1);
>> �� }
>> �� a = strtold(argv[1], &num_end);
>> �� b = modfl(a, &c);
>> �� printf("%Lf %Lf %Lf\n", a, b, c);
>> �� return 0;
>> }
>>
>> $ gcc -Og -ggdb -g3 -Wall -Wextra -std=c99 -pedantic test.c -o test.exe
>>
>> $ ./test.exe 123.456
>> Segmentation fault (core dumped)
>>
>> $ gdb --args ./test.exe 123.456
>> GNU gdb (GDB) (Cygwin 8.3.1-1) 8.3.1
>> ...
>> Reading symbols from ./test.exe...
>> (gdb) break modfl
>> (gdb) run
>>
>> Thread 1 "test" hit Breakpoint 1, modfl (value=<optimized out>,
>> iptr=iptr AT entry=0xffffcbd0) at
>> /usr/src/debug/cygwin-3.1.7-1/winsup/cygwin/math/modfl.c:16
>> ...
>> 40������� return (isinf (value) ?� 0.0L : value - int_part);
>> (gdb) step
>> ������ 0 [main] test 28439 cygwin_exception::open_stackdumpfile: Dumping
>> ...
>> (gdb)
>>
>> isinf and isinfl both work just fine, so I'm not sure what's going on
>> there.
>
> I built a version of cygwin1.dll without optimization in the hopes of
> making debugging easier, but the problem doesn't occur with that DLL.�
> So this is somehow tied up with optimization.� BTW, isinf is a macro
> that expands to __builtin_isinf_sign, again suggesting that
> optimization is involved.
>
> That's as far as I can take it.

Stepping back through Cygwin releases, I find:

$ gcc -Og -ggdb -g3 -Wall -Wextra -std=c99 -pedantic test.c -o test.exe

$ ./test.exe 123.456
123.456000 0.456000 123.000000

$ uname -a | sed "s/${HOSTNAME}/\${HOSTNAME}/g"
CYGWIN_NT-10.0 ${HOSTNAME} 3.1.4(0.340/5/3) 2020-02-19 08:49 x86_64 Cygwin

$ gcc --version
gcc (GCC) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.� There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


3.1.5 crashed the same way as 3.1.7.� There's nothing obvious in the
3.1.5 announcement [1],
so I'm stuck again.

>
> Ken


[1] https://cygwin.com/pipermail/cygwin-announce/2020-June/009561.html

--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019