[QUAR] Re: cpp /usr/include/threads.h fails; modfl segfaults

Eliot Moss moss@cs.umass.edu
Sat Aug 29 21:41:09 GMT 2020


On 8/29/2020 1:57 PM, Ken Brown via Cygwin wrote:

 >> #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;
 >> }

I'm using gcc 9.3, and this dies in modfl where it is trying to store the result back.  The -O level 
does not seem to matter.  modfl seems seriously broken.  It comes from winsup in
base cygwin.  I was running 3.1.6-1.  I upgraded to 3.1.7-1 and got the same thing.  This
is the 64-bit cygwin.

The 32-bit version of cygwin 3.1.6-1 processes and runs this just fine.  Same version
of gcc.

It seems the math functions in winsup were not built quite right ...

Regards - Eliot Moss


More information about the Cygwin mailing list