Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ext/POSIX/t/math.t fails on FreeBSD 9.1 i386 #15275

Open
p5pRT opened this issue Apr 14, 2016 · 5 comments
Open

ext/POSIX/t/math.t fails on FreeBSD 9.1 i386 #15275

p5pRT opened this issue Apr 14, 2016 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Apr 14, 2016

Migrated from rt.perl.org#127895 (status was 'open')

Searchable as RT127895$

@p5pRT
Copy link
Author

p5pRT commented Apr 14, 2016

From @tonycoz

This looks like more of our friend from #125710​:

[tony@​freebsd32-91 ~/src/perl-5.24.0-RC1/t]$ ./perl harness -v ../ext/POSIX/t/math.t
../ext/POSIX/t/math.t ..
ok 1 - Basic acos(1) test

ok 2 - acos(-1)
...
ok 124 - setpayloadsig + getpayload
not ok 125 - setpayloadsig + issignaling
# Failed test 'setpayloadsig + issignaling'
# at t/math.t line 196.
ok 126 - nan + getpayload
ok 127 - nan + getpayload 2**31
...
ok 137 - issignaling -Inf
ok 138 - issignaling NaN
1..138
# Looks like you failed 1 test of 138.
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/138 subtests

Test Summary Report


../ext/POSIX/t/math.t (Wstat​: 256 Tests​: 138 Failed​: 1)
  Failed test​: 125
  Non-zero exit status​: 1
Files=1, Tests=138, 0 wallclock secs ( 0.01 usr 0.02 sys + 0.05 cusr 0.00 csys = 0.09 CPU)
Result​: FAIL
[tony@​freebsd32-91 ~/src/perl-5.24.0-RC1/t]$ ../perl -I../lib -V​:byteorder -V​:longdblkind -V​:ptrsize -V​:doublekind
byteorder='1234';
longdblkind='-1';
ptrsize='4';
doublekind='3';

It looks like Configure isn't picking up the type of long double properly, long double does appear to be implemented​:

[tony@​freebsd32-91 ~/play]$ cat ldbl.c
#include <stdio.h>

int main() {
  long double x = 5.0;
  printf("x %Lf size %zd\n", x, sizeof(x));
  return 0;
}

[tony@​freebsd32-91 ~/play]$ cc -oldbl ldbl.c
[tony@​freebsd32-91 ~/play]$ ./ldbl
x 5.000000 size 12

Tony

@p5pRT
Copy link
Author

p5pRT commented Apr 14, 2016

From mat@cpan.org

Le Mer 13 Avr 2016 22​:00​:36, tonyc a écrit :

This looks like more of our friend from #125710​:

[tony@​freebsd32-91 ~/src/perl-5.24.0-RC1/t]$ ./perl harness -v

I don't know what policy Perl has regarding OS support, but does this happen on a supported (by FreeBSD) FreeBSD version ? (the supported versions until the end of 2016 are 9.3, 10.1, 10.2 and 10.3)

(Because I can't reproduce this on 9.3 or 10.1 myself.)

@p5pRT
Copy link
Author

p5pRT commented Apr 14, 2016

From [Unknown Contact. See original ticket]

Le Mer 13 Avr 2016 22​:00​:36, tonyc a écrit :

This looks like more of our friend from #125710​:

[tony@​freebsd32-91 ~/src/perl-5.24.0-RC1/t]$ ./perl harness -v

I don't know what policy Perl has regarding OS support, but does this happen on a supported (by FreeBSD) FreeBSD version ? (the supported versions until the end of 2016 are 9.3, 10.1, 10.2 and 10.3)

(Because I can't reproduce this on 9.3 or 10.1 myself.)

@p5pRT
Copy link
Author

p5pRT commented Apr 18, 2016

From @tonycoz

On Thu Apr 14 01​:50​:11 2016, mat@​cpan.org wrote​:

Le Mer 13 Avr 2016 22​:00​:36, tonyc a écrit :

This looks like more of our friend from #125710​:

[tony@​freebsd32-91 ~/src/perl-5.24.0-RC1/t]$ ./perl harness -v

I don't know what policy Perl has regarding OS support, but does this
happen on a supported (by FreeBSD) FreeBSD version ? (the supported
versions until the end of 2016 are 9.3, 10.1, 10.2 and 10.3)

(Because I can't reproduce this on 9.3 or 10.1 myself.)

We do support older operating systems.

I reproduced your success on 10.3.

But it does fail for me on 9.3​:

$ cd t
$ ./perl harness ../ext/POSIX/t/math.t
../ext/POSIX/t/math.t .. 1/?
# Failed test 'setpayloadsig + issignaling'
# at t/math.t line 196.
# Looks like you failed 1 test of 138.
../ext/POSIX/t/math.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/138 subtests

Test Summary Report


../ext/POSIX/t/math.t (Wstat​: 256 Tests​: 138 Failed​: 1)
  Failed test​: 125
  Non-zero exit status​: 1
Files=1, Tests=138, 1 wallclock secs ( 0.02 usr 0.01 sys + 0.06 cusr 0.00 csys = 0.09 CPU)
Result​: FAIL
$ uname -a
FreeBSD freebsd93-i386 9.3-RELEASE FreeBSD 9.3-RELEASE #0 r268512​: Fri Jul 11 03​:13​:02 UTC 2014 root@​snap.freebsd.org​:/usr/obj/usr/src/sys/GENERIC i386

Note that the issues with the test are i386 specific - if you tested on amd64 you won't see the problem - see https://rt-archive.perl.org/perl5/Ticket/Display.html?id=125710#txn-1359801 for the ugly details.

This looks like the compiler is storing long double constants as doubles and then converting them to long double when generating code.

With the initialization of​:

  static const long double d = -0.1L;

the bytes in d were​:

  00 d0 cc cc cc cc cc cc fb bf 00 00

The same happened with an initialization of​:

  static const long double d = -1.0L/10.0L;

But if I make d non constant and initialize it like​:

  sscanf("-0.1", "%Lf", &d);

the bytes in d are​:

  cd cc cc cc cc cc cc cc fb bf 00 00

which matches what I see on my x86_64 box except for the padding.

Tony

@p5pRT
Copy link
Author

p5pRT commented Feb 17, 2017

@jkeenan - Status changed from 'new' to 'open'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants