develooper Front page | perl.perl5.porters | Postings from April 2019

[perl #134031] BBC: blead breaks SHELDRAKE/Math-Clipper-1.27.tar.gz

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
April 30, 2019 01:41
Subject:
[perl #134031] BBC: blead breaks SHELDRAKE/Math-Clipper-1.27.tar.gz
Message ID:
rt-4.0.24-2016-1556588479-863.134031-15-0@perl.org
On Wed, 24 Apr 2019 22:39:22 GMT, public@khwilliamson.com wrote:
> On 4/24/19 4:29 PM, James E Keenan via RT wrote:
> > On Wed, 24 Apr 2019 17:04:49 GMT, public@khwilliamson.com wrote:
> >> On 4/24/19 10:35 AM, James E Keenan via RT wrote:
> >>> On Wed, 24 Apr 2019 15:50:43 GMT, khw wrote:
> >>>> On Wed, 24 Apr 2019 07:36:31 -0700, davem wrote:
> >>>>> On Mon, Apr 15, 2019 at 04:26:42PM +1000, sisyphus wrote:
> >>>>>> Well, of course, that commit simply switched the assigning of
> >>>>>> floating
> >>>>>> point values from perl's atof() over to the underlying C
> >>>>>> environment's
> >>>>>> strtod().
> >>>>>>
> >>>>>> It looks like we have here the rare case where strtod() assigns
> >>>>>> a
> >>>>>> floating
> >>>>>> point value incorrectly, yet perl's atof() assigns it correctly.
> >>>>>>
> >>>>>> I don't have access to any FreeBSD machines, so that's about the
> >>>>>> best
> >>>>>> guess
> >>>>>> I can make at the moment.
> >>>>>>
> >>>>>> What follows is even more speculative:
> >>>>>>
> >>>>>> The failing tests specify (in their data) the floating
> >>>>>> point values 0.00000000000002, 5.67999999999999,
> >>>>>> 56.78888888888888,
> >>>>>> and
> >>>>>> 56.77777777777777.
> >>>>>> I therefore suspect that the following would produce output if
> >>>>>> run
> >>>>>> on Slaven's 5.28.x perls (where Math-Clipper-1.27 succeeds):
> >>>>>> $ perl -MPOSIX="strtod" -le 'for (qw(0.00000000000002
> >>>>>> 5.67999999999999
> >>>>>> 56.78888888888888 56.77777777777777)) {print "$_ NOT ok" if $_
> >>>>>> !=
> >>>>>> strtod($_)};'
> >>>>>>
> >>>>>> I guess the way we would then proceed is to first try to
> >>>>>> determine
> >>>>>> just how
> >>>>>> bad strtod's assignment on these FreeBSD boxes actually is. If
> >>>>>> it's
> >>>>>> worse
> >>>>>> than perl's atof (), then we should be recommending that these
> >>>>>> systems
> >>>>>> configure their builds of perl with "-Ud_strtod" (and "-
> >>>>>> Ud_strtod
> >>>>>> -Ud_strtold" for "-Duselongdouble" builds) - as that will revert
> >>>>>> to
> >>>>>> using
> >>>>>> perl's atof().
> >>>>>> We should probably also point out that doing so means that
> >>>>>> POSIX::strtod/strtold are then unavailable.
> >>>>>> Such builds of perl are pretty much untested.
> >>>>>> I've just tried a -Ud_strtod build of 5.29.9 on Ubuntu 18.04,
> >>>>>> and
> >>>>>> it
> >>>>>> went
> >>>>>> fine and passed all tests - but that's not a particularly large
> >>>>>> sample.
> >>>>>> Of course, it has lots of floating point values that are
> >>>>>> assigned
> >>>>>> incorrectly .... but other than that, it seems fine.
> >>>>>>
> >>>>>> I don't know if someone with one of these problem FreeBSD
> >>>>>> systems
> >>>>>> would
> >>>>>> like to build a 5.29.9 with "-Ud_strtod" and then verify that
> >>>>>> Math-Clipper-1.27 does then build and test successfully.
> >>>>>> Not sure that it's really necessary, but it would at least
> >>>>>> provide
> >>>>>> a
> >>>>>> useful
> >>>>>> confirmation.
> >>>>>
> >>>>> Would this issue have been addressed by Karl's recent addition of
> >>>>> Strtod(), v5.29.9-165-g9ec8aea5c0?
> >>>>
> >>>> very doubtful.  I think someone should try Rob's suggestion
> >>>
> >>> I don't know if I interpreted his suggestion correctly, but this is
> >>> what I tried on FreeBSD-11.2.
> >>>
> >>> #####
> >>> [abd494f123f7d413dd85748f8b52e08508476fee] $ ./bin/perl -Ilib
> >>> -V:config_args
> >>> config_args='-des -Dusedevel -Dusethreads -Ud_strtod
> >>> -Dprefix=/home/jkeenan/testing/abd494f123f7d413dd85748f8b52e08508476fee
> >>> -Uversiononly -Dman1dir=none -Dman3dir=none';
> >>>
> >>> [abd494f123f7d413dd85748f8b52e08508476fee] $ ./bin/perl -Ilib -V |
> >>> grep -i strtod
> >>>       config_args='-des -Dusedevel -Dusethreads -Ud_strtod
> >>> -Dprefix=/home/jkeenan/testing/abd494f123f7d413dd85748f8b52e08508476fee
> >>> -Uversiononly -Dman1dir=none -Dman3dir=none'
> >>>
> >>> [abd494f123f7d413dd85748f8b52e08508476fee] $
> >>>
> >>> [abd494f123f7d413dd85748f8b52e08508476fee] $ ./bin/cpanm
> >>> Math::Clipper
> >>> [snip]
> >>> Building and testing Math-Clipper-1.27 ... OK
> >>> Successfully installed Math-Clipper-1.27
> >>> 13 distributions installed
> >>> #####
> >>>
> >>> So the distro was installed ... but I doubt that the special
> >>> configuration switch '-Ud_strtod' "took":
> >>>
> >>> #####
> >>> [abd494f123f7d413dd85748f8b52e08508476fee] $ ./bin/perl -Ilib
> >>> -MConfig -MData::Dumper -E 'say Dumper \%Config;' 2>&1 | grep -i
> >>> strtod
> >>>             'config_arg4' => '-Ud_strtod',
> >>>             'config_args' => '-des -Dusedevel -Dusethreads
> >>> -Ud_strtod
> >>> -Dprefix=/home/jkeenan/testing/abd494f123f7d413dd85748f8b52e08508476fee
> >>> -Uversiononly -Dman1dir=none -Dman3dir=none',
> >>>             'd_strtod' => undef,
> >>>             'd_strtod_l' => 'define',
> >>> #####
> >>>
> >>> Thank you very much.
> >>>
> >>
> >> Try adding also -Ud_strtod_l
> >
> > #####
> > [abd494f123f7d413dd85748f8b52e08508476fee] $ ./bin/perl -Ilib
> > -MConfig -MData::Dumper -E 'say Dumper \%Config;' 2>&1 | grep -i
> > strtod
> >            'config_arg4' => '-Ud_strtod',
> >            'config_arg5' => '-Ud_strtod_l',
> >            'config_args' => '-des -Dusedevel -Dusethreads -Ud_strtod
> > -Ud_strtod_l
> > -Dprefix=/home/jkeenan/testing/abd494f123f7d413dd85748f8b52e08508476fee
> > -Uversiononly -Dman1dir=none -Dman3dir=none',
> >            'd_strtod' => undef,
> >            'd_strtod_l' => undef,
> >
> > $ ./bin/cpanm Math::Clipper
> > [snip]
> > Building and testing Math-Clipper-1.27 ... OK
> > Successfully installed Math-Clipper-1.27
> > #####
> >
> > #####
> >
> >>
> >> The latter should only be used under threads.  So if you run the
> >> distros
> >> tests without threads it should have worked if Rob's hypothesis is
> >> correct
> >
> > Next, with both d_strtod* switches but without threads.
> >
> > #####
> > [abd494f123f7d413dd85748f8b52e08508476fee] $ ./bin/perl -Ilib
> > -MConfig -MData::Dumper -E 'say Dumper \%Config;' 2>&1 | ack -i
> > '(strtod|use\S*?thread)'
> >            'config_arg3' => '-Ud_strtod',
> >            'config_arg4' => '-Ud_strtod_l',
> >            'config_args' => '-des -Dusedevel -Ud_strtod -Ud_strtod_l
> > -Dprefix=/home/jkeenan/testing/abd494f123f7d413dd85748f8b52e08508476fee
> > -Uversiononly -Dman1dir=none -Dman3dir=none',
> >            'd_strtod' => undef,
> >            'd_strtod_l' => undef,
> >            'use5005threads' => undef,
> >            'useithreads' => undef,
> >            'usethreads' => undef,
> >
> >
> > $ ./bin/cpanm Math::Clipper
> > [snip]
> > Building and testing Math-Clipper-1.27 ... OK
> > Successfully installed Math-Clipper-1.27
> > #####
> >
> > And that proves ... what exactly?
> >
> 
> I believe it proves Rob's hypothesis, namely
> 
> "It looks like we have here the rare case where strtod() assigns a
> floating point value incorrectly, yet perl's atof() assigns it
> correctly."
> 
> And that the fix is to make the hints file for the affected platforms
> undefine these to switches.

Karl,

At your suggestion on IRC, on FreeBSD-11.2, I built a perl from the smoke-me/khw-clipper branch with my customary config args on this platform:

#####
[khw-clipper] $ ./bin/perl -Ilib -V:config_args
config_args='-des -Dusedevel -Uversiononly -Dprefix=/home/jkeenan/testing/smoke-me/khw-clipper -Dman1dir=none -Dman3dir=none -Duseithreads -Doptimize=-O2 -pipe -fstack-protector -fno-strict-aliasing';
#####

I then attempted to install Math::Clipper via cpanm.  It failed.

#####
"~/.cpanm/work/1556587520.89907/build.log" 1237L, 65160C                                 1,1           Top
# Comparing $data as a Bag
# Missing: 1 reference
# Extra: 1 reference
# Looks like you failed 2 tests of 15.
t/008integerize.t ........
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/15 subtests
#####

I then built an unthreaded perl on that branch and attempted to install Math::Clipper via cpanm.

#####
export UNTHREADED_PERL_ARGS="-des -Dusedevel" && \
   install_custom_branch_for_testing.sh smoke-me/khw-clipper "$UNTHREADED_PERL_ARGS"
#####

I got the same test failures.  Where does that leave us?

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

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=134031

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About