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 failure #17033

Closed
p5pRT opened this issue Jun 3, 2019 · 15 comments
Closed

ext/POSIX/t/math.t failure #17033

p5pRT opened this issue Jun 3, 2019 · 15 comments

Comments

@p5pRT
Copy link
Collaborator

@p5pRT p5pRT commented Jun 3, 2019

Migrated from rt.perl.org#134171 (status was 'resolved')

Searchable as RT134171$

@p5pRT
Copy link
Collaborator Author

@p5pRT p5pRT commented Jun 3, 2019

From rares.aioanei@gmail.com

Created by rares.aioanei@gmail.com

Subject​: ext/POSIX/t/math.t failure
Message-Id​: <5.30.0_11724_1559578277@​openindiana>
From​: rares.aioanei@​gmail.com
Reply-To​: rares.aioanei@​gmail.com
Cc​: arares@​openindiana.local
To​: perlbug@​perl.org

This is a bug report for perl from rares.aioanei@​gmail.com,
generated with the help of perlbug 1.41 running under perl 5.30.0.

-----------------------------------------------------------------
ext/POSIX/t/math.t fails on Solaris (OpenIndiana Hipster) with :

# Failed test 'tanh(-1)'
# at t/math.t line 55.
# '0.761594155955765'
# <=
# '-0.76'

# Failed test 'tanh(1) == -tanh(-1)'
# at t/math.t line 56.
# got​: 0.761594155955765
# expected​: -0.761594155955765

Perl Info

Flags:
    category=core
    severity=low

Site configuration information for perl 5.30.0:

Configured by arares at Mon Jun  3 17:59:03 EEST 2019.

Summary of my perl5 (revision 5 version 30 subversion 0) configuration:

  Platform:
    osname=solaris
    osvers=2.11
    archname=i86pc-solaris
    uname='sunos openindiana 5.11 illumos-ffec1fd1b2 i86pc i386 i86pc '
    config_args=''
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=undef
    usemultiplicity=undef
    use64bitint=undef
    use64bitall=undef
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
    cc='gcc'
    ccflags ='-fwrapv -fno-strict-aliasing -pipe
-fstack-protector-strong -I/usr/gnu/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -DPERL_USE_SAFE_PUTENV'
    optimize='-O'
    cppflags='-fwrapv -fno-strict-aliasing -pipe
-fstack-protector-strong -I/usr/gnu/include'
    ccversion=''
    gccversion='6.5.0'
    gccosandvers=''
    intsize=4
    longsize=4
    ptrsize=4
    doublesize=8
    byteorder=1234
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=12
    longdblkind=3
    ivtype='long'
    ivsize=4
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=4
    prototype=define
  Linker and Libraries:
    ld='gcc'
    ldflags =' -fstack-protector-strong -L/usr/gnu/lib '
    libpth=/usr/gcc/6/lib /usr/lib /usr/gnu/lib /usr/ccs/lib
    libs=-lpthread -lsocket -lnsl -lgdbm -ldb -ldl -lm -lc
    perllibs=-lpthread -lsocket -lnsl -ldl -lm -lc
    libc=/lib/libc.so
    so=so
    useshrplib=true
    libperl=libperl.so
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='  -R /opt/lib/perl5/5.30.0/i86pc-solaris/CORE'
    cccdlflags='-fPIC'
    lddlflags='-shared -L/usr/gnu/lib -fstack-protector-strong'



@INC for perl 5.30.0:
    /opt/lib/perl5/site_perl/5.30.0/i86pc-solaris
    /opt/lib/perl5/site_perl/5.30.0
    /opt/lib/perl5/5.30.0/i86pc-solaris
    /opt/lib/perl5/5.30.0


Environment for perl 5.30.0:
    HOME=/export/home/arares
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/bin:/usr/sbin:/sbin:/usr/gnu/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Collaborator Author

@p5pRT p5pRT commented Jun 3, 2019

From @jkeenan

On Mon, 03 Jun 2019 19​:18​:10 GMT, rares.aioanei@​gmail.com wrote​:

Subject​: ext/POSIX/t/math.t failure
Message-Id​: <5.30.0_11724_1559578277@​openindiana>
From​: rares.aioanei@​gmail.com
Reply-To​: rares.aioanei@​gmail.com
Cc​: arares@​openindiana.local
To​: perlbug@​perl.org

This is a bug report for perl from rares.aioanei@​gmail.com,
generated with the help of perlbug 1.41 running under perl 5.30.0.

-----------------------------------------------------------------
ext/POSIX/t/math.t fails on Solaris (OpenIndiana Hipster) with :

# Failed test 'tanh(-1)'
# at t/math.t line 55.
# '0.761594155955765'
# <=
# '-0.76'

# Failed test 'tanh(1) == -tanh(-1)'
# at t/math.t line 56.
# got​: 0.761594155955765
# expected​: -0.761594155955765

Are you in a position to run a test where you add the following option to Perl's ./Configure program?

#####
-Duse64bitall
#####

That is, configure and build like this​:

#####
sh ./Configure -des -Dusedevel -Duse64bitall && make test_prep
#####

... and then run​:

#####
cd t;./perl harness -v ../ext/POSIX/t/math.t;cd -
#####

I ask, because if the test in question PASSes when perl is configured with '-Duse64bitall', that would be consistent with some smoke test reports we have been receiving, e.g.,

http​://perl5.test-smoke.org/report/88747
http​://perl5.test-smoke.org/report/88826

Unfortunately, while we have been receiving these smoke-test reports, we haven't been in position to fully diagnose this on Solaris.

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Collaborator Author

@p5pRT p5pRT commented Jun 3, 2019

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Collaborator Author

@p5pRT p5pRT commented Jun 4, 2019

From @sisyphus

That is, configure and build like this​:

#####
sh ./Configure -des -Dusedevel -Duse64bitall && make test_prep
#####

... and then run​:

#####
cd t;./perl harness -v ../ext/POSIX/t/math.t;cd -
#####

To the OP​:
If you're able to do that, and it fixes the problem, could you also provide the 'perl -V' output for this new build.

Also (as a stab in the dark), on your first build, could you confirm that tanh(-1) and tanh(-1.0) are both returning the same incorrect value of 0.761594155955765.
The value should be -0.761594155955765.

Cheers,
Rob

@p5pRT
Copy link
Collaborator Author

@p5pRT p5pRT commented Jun 7, 2019

From rares.aioanei@gmail.com

On Mon, 03 Jun 2019 18​:16​:09 -0700, sisyphus@​cpan.org wrote​:

That is, configure and build like this​:

#####
sh ./Configure -des -Dusedevel -Duse64bitall && make test_prep
#####

... and then run​:

#####
cd t;./perl harness -v ../ext/POSIX/t/math.t;cd -
#####

To the OP​:
If you're able to do that, and it fixes the problem, could you also
provide the 'perl -V' output for this new build.

Also (as a stab in the dark), on your first build, could you confirm
that tanh(-1) and tanh(-1.0) are both returning the same incorrect
value of 0.761594155955765.
The value should be -0.761594155955765.

Cheers,
Rob

Attached is the output of 'perl -V' as requested. 'make test' succeeds and both calls to tanh() return the same value, the one you predicted. Please let me know if there is anything else or if you need testing on Solaris in the future.

@p5pRT
Copy link
Collaborator Author

@p5pRT p5pRT commented Jun 7, 2019

@p5pRT
Copy link
Collaborator Author

@p5pRT p5pRT commented Jun 7, 2019

From @sisyphus

On Fri, 07 Jun 2019 06​:39​:03 -0700, rares.aioanei@​gmail.com wrote​:

Attached is the output of 'perl -V' as requested. 'make test' succeeds
and both calls to tanh() return the same value, the one you predicted.
Please let me know if there is anything else or if you need testing on
Solaris in the future.

We can see from that 'perl -V' output that the "-Duse64bitall" argument puts the C compiler into 64 bit mode.
It therefore appears that, although the 32 bit mode of tanh() is buggy, the 64 bit mode works correctly.

Should we consider providing a fix/workaround for the 32 bit mode calculation ?
I don't know ... I would simply offer the advice "configure your perl build with -Duse64bitall" and leave it at that, but others might consider that to be inadequate ....

Cheers,
Rob

@p5pRT
Copy link
Collaborator Author

@p5pRT p5pRT commented Jun 7, 2019

From rares.aioanei@gmail.com

On Fri, 07 Jun 2019 07​:15​:21 -0700, sisyphus@​cpan.org wrote​:

On Fri, 07 Jun 2019 06​:39​:03 -0700, rares.aioanei@​gmail.com wrote​:

Attached is the output of 'perl -V' as requested. 'make test'
succeeds
and both calls to tanh() return the same value, the one you
predicted.
Please let me know if there is anything else or if you need testing
on
Solaris in the future.

We can see from that 'perl -V' output that the "-Duse64bitall"
argument puts the C compiler into 64 bit mode.
It therefore appears that, although the 32 bit mode of tanh() is
buggy, the 64 bit mode works correctly.

Should we consider providing a fix/workaround for the 32 bit mode
calculation ?
I don't know ... I would simply offer the advice "configure your perl
build with -Duse64bitall" and leave it at that, but others might
consider that to be inadequate ....

Cheers,
Rob

Just a side norte here....the perl compiled with '-Duse64bitall' returns the same values when calling tanh() as the 32-bit one does, although the math.t test fails only with the 32-bit one.

@p5pRT
Copy link
Collaborator Author

@p5pRT p5pRT commented Jun 7, 2019

From @jkeenan

On Fri, 07 Jun 2019 14​:15​:21 GMT, sisyphus@​cpan.org wrote​:

On Fri, 07 Jun 2019 06​:39​:03 -0700, rares.aioanei@​gmail.com wrote​:

Attached is the output of 'perl -V' as requested. 'make test'
succeeds
and both calls to tanh() return the same value, the one you
predicted.
Please let me know if there is anything else or if you need testing
on
Solaris in the future.

We can see from that 'perl -V' output that the "-Duse64bitall"
argument puts the C compiler into 64 bit mode.
It therefore appears that, although the 32 bit mode of tanh() is
buggy, the 64 bit mode works correctly.

Should we consider providing a fix/workaround for the 32 bit mode
calculation ?
I don't know ... I would simply offer the advice "configure your perl
build with -Duse64bitall" and leave it at that, but others might
consider that to be inadequate ....

Cheers,
Rob

One possible approach​: revise hints/solaris_2.sh. The string 'use64bitall' already occurs within that (and other) hints files.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Collaborator Author

@p5pRT p5pRT commented Jun 11, 2019

From rares.aioanei@gmail.com

Yes, they return the same value. And here's the output of perl -V :

Summary of my perl5 (revision 5 version 30 subversion 0) configuration​:

  Platform​:
  osname=solaris
  osvers=2.11
  archname=i86pc-solaris
  uname='sunos openindiana 5.11 illumos-ffec1fd1b2 i86pc i386 i86pc '
  config_args=''
  hint=recommended
  useposix=true
  d_sigaction=define
  useithreads=undef
  usemultiplicity=undef
  use64bitint=undef
  use64bitall=undef
  uselongdouble=undef
  usemymalloc=n
  default_inc_excludes_dot=define
  bincompat5005=undef
  Compiler​:
  cc='gcc'
  ccflags ='-fwrapv -fno-strict-aliasing -pipe
-fstack-protector-strong -I/usr/gnu/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -DPERL_USE_SAFE_PUTENV'
  optimize='-O'
  cppflags='-fwrapv -fno-strict-aliasing -pipe
-fstack-protector-strong -I/usr/gnu/include'
  ccversion=''
  gccversion='6.5.0'
  gccosandvers=''
  intsize=4
  longsize=4
  ptrsize=4
  doublesize=8
  byteorder=1234
  doublekind=3
  d_longlong=define
  longlongsize=8
  d_longdbl=define
  longdblsize=12
  longdblkind=3
  ivtype='long'
  ivsize=4
  nvtype='double'
  nvsize=8
  Off_t='off_t'
  lseeksize=8
  alignbytes=4
  prototype=define
  Linker and Libraries​:
  ld='gcc'
  ldflags =' -fstack-protector-strong -L/usr/gnu/lib '
  libpth=/usr/gcc/6/lib /usr/lib /usr/gnu/lib /usr/ccs/lib
  libs=-lpthread -lsocket -lnsl -lgdbm -ldb -ldl -lm -lc
  perllibs=-lpthread -lsocket -lnsl -ldl -lm -lc
  libc=/lib/libc.so
  so=so
  useshrplib=true
  libperl=libperl.so
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs
  dlext=so
  d_dlsymun=undef
  ccdlflags=' -R /opt/lib/perl5/5.30.0/i86pc-solaris/CORE'
  cccdlflags='-fPIC'
  lddlflags='-shared -L/usr/gnu/lib -fstack-protector-strong'

Characteristics of this binary (from libperl)​:
  Compile-time options​:
  HAS_TIMES
  PERLIO_LAYERS
  PERL_COPY_ON_WRITE
  PERL_DONT_CREATE_GVSV
  PERL_MALLOC_WRAP
  PERL_OP_PARENT
  PERL_PRESERVE_IVUV
  PERL_USE_SAFE_PUTENV
  USE_LARGE_FILES
  USE_LOCALE
  USE_LOCALE_COLLATE
  USE_LOCALE_CTYPE
  USE_LOCALE_NUMERIC
  USE_LOCALE_TIME
  USE_PERLIO
  USE_PERL_ATOF
  Built under solaris
  Compiled at Jun 3 2019 18​:02​:06
  @​INC​:
  /opt/lib/perl5/site_perl/5.30.0/i86pc-solaris
  /opt/lib/perl5/site_perl/5.30.0
  /opt/lib/perl5/5.30.0/i86pc-solaris
  /opt/lib/perl5/5.30.0

On Tue, Jun 4, 2019 at 4​:16 AM sisyphus@​cpan.org via RT
<perlbug-followup@​perl.org> wrote​:

That is, configure and build like this​:

#####
sh ./Configure -des -Dusedevel -Duse64bitall && make test_prep
#####

... and then run​:

#####
cd t;./perl harness -v ../ext/POSIX/t/math.t;cd -
#####

To the OP​:
If you're able to do that, and it fixes the problem, could you also provide the 'perl -V' output for this new build.

Also (as a stab in the dark), on your first build, could you confirm that tanh(-1) and tanh(-1.0) are both returning the same incorrect value of 0.761594155955765.
The value should be -0.761594155955765.

Cheers,
Rob

@p5pRT
Copy link
Collaborator Author

@p5pRT p5pRT commented Aug 1, 2019

From @tonycoz

On Mon, 03 Jun 2019 12​:18​:10 -0700, rares.aioanei@​gmail.com wrote​:

ext/POSIX/t/math.t fails on Solaris (OpenIndiana Hipster) with :

# Failed test 'tanh(-1)'
# at t/math.t line 55.
# '0.761594155955765'
# <=
# '-0.76'

# Failed test 'tanh(1) == -tanh(-1)'
# at t/math.t line 56.
# got​: 0.761594155955765
# expected​: -0.761594155955765

This looks like it's caused by​:

https://www.illumos.org/issues/11175

and my illumos-2d6125aab2 system passes these tests when built without -Duse64bitint.

Tony

@p5pRT
Copy link
Collaborator Author

@p5pRT p5pRT commented Aug 3, 2019

From @jkeenan

On Thu, 01 Aug 2019 04​:12​:36 GMT, tonyc wrote​:

On Mon, 03 Jun 2019 12​:18​:10 -0700, rares.aioanei@​gmail.com wrote​:

ext/POSIX/t/math.t fails on Solaris (OpenIndiana Hipster) with :

# Failed test 'tanh(-1)'
# at t/math.t line 55.
# '0.761594155955765'
# <=
# '-0.76'

# Failed test 'tanh(1) == -tanh(-1)'
# at t/math.t line 56.
# got​: 0.761594155955765
# expected​: -0.761594155955765

This looks like it's caused by​:

https://www.illumos.org/issues/11175

and my illumos-2d6125aab2 system passes these tests when built without
-Duse64bitint.

Tony

Will we have to wait for a new release of Illumos in order to close this ticket?

Thank you very much.
--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Collaborator Author

@p5pRT p5pRT commented Aug 5, 2019

From @tonycoz

On Fri, 02 Aug 2019 18​:43​:48 -0700, jkeenan wrote​:

On Thu, 01 Aug 2019 04​:12​:36 GMT, tonyc wrote​:

On Mon, 03 Jun 2019 12​:18​:10 -0700, rares.aioanei@​gmail.com wrote​:

ext/POSIX/t/math.t fails on Solaris (OpenIndiana Hipster) with :

# Failed test 'tanh(-1)'
# at t/math.t line 55.
# '0.761594155955765'
# <=
# '-0.76'

# Failed test 'tanh(1) == -tanh(-1)'
# at t/math.t line 56.
# got​: 0.761594155955765
# expected​: -0.761594155955765

This looks like it's caused by​:

https://www.illumos.org/issues/11175

and my illumos-2d6125aab2 system passes these tests when built
without
-Duse64bitint.

Tony

Will we have to wait for a new release of Illumos in order to close
this ticket?

Thank you very much.

The OP appears to be running a development release of OpenIndiana.

2019.04 has illumos at git commit a547acf91a[1], Sun Apr 28 18​:59​:18 2019 +0000.

The OP's uname string indicates they have a later prerelease ffec1fd1b2, Thu May 9 17​:19​:27 2019 +0000.

The release I downloaded, which includes the fix is dated Sat Jun 22 10​:26​:20 2019 +0300.

I expect the OP could already update to fix the issue.

Tony

[1] https://wiki.openindiana.org/oi/2019.04+Release+notes

@p5pRT
Copy link
Collaborator Author

@p5pRT p5pRT commented Sep 6, 2019

From @tonycoz

On Sun, 04 Aug 2019 18​:01​:16 -0700, tonyc wrote​:

On Fri, 02 Aug 2019 18​:43​:48 -0700, jkeenan wrote​:

On Thu, 01 Aug 2019 04​:12​:36 GMT, tonyc wrote​:

On Mon, 03 Jun 2019 12​:18​:10 -0700, rares.aioanei@​gmail.com wrote​:

ext/POSIX/t/math.t fails on Solaris (OpenIndiana Hipster) with :

# Failed test 'tanh(-1)'
# at t/math.t line 55.
# '0.761594155955765'
# <=
# '-0.76'

# Failed test 'tanh(1) == -tanh(-1)'
# at t/math.t line 56.
# got​: 0.761594155955765
# expected​: -0.761594155955765

This looks like it's caused by​:

https://www.illumos.org/issues/11175

and my illumos-2d6125aab2 system passes these tests when built
without
-Duse64bitint.

Tony

Will we have to wait for a new release of Illumos in order to close
this ticket?

Thank you very much.

The OP appears to be running a development release of OpenIndiana.

2019.04 has illumos at git commit a547acf91a[1], Sun Apr 28 18​:59​:18
2019 +0000.

The OP's uname string indicates they have a later prerelease
ffec1fd1b2, Thu May 9 17​:19​:27 2019 +0000.

The release I downloaded, which includes the fix is dated Sat Jun 22
10​:26​:20 2019 +0300.

I expect the OP could already update to fix the issue.

Tony

[1] https://wiki.openindiana.org/oi/2019.04+Release+notes

Since this is fixed upstream, closing.

Tony

@p5pRT
Copy link
Collaborator Author

@p5pRT p5pRT commented Sep 6, 2019

@tonycoz - Status changed from 'open' to 'resolved'

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

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.