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

Re: 5.27.11 fails ../lib/File/Copy.t on linux (ubuntu-16.04)with-Dusequadmath

Thread Previous
From:
Dave Mitchell
Date:
April 27, 2018 19:33
Subject:
Re: 5.27.11 fails ../lib/File/Copy.t on linux (ubuntu-16.04)with-Dusequadmath
Message ID:
20180427193342.GB597@iabyn.com
On Fri, Apr 27, 2018 at 02:42:21PM -0400, James E Keenan wrote:
> On 04/27/2018 09:29 AM, Dave Mitchell wrote:
> > On Thu, Apr 26, 2018 at 12:12:04AM +1000, sisyphus1@optusnet.com.au wrote:
> > > -----Original Message----- From: Dave Mitchell
> > > Sent: Wednesday, April 25, 2018 11:58 PM
> > > To: sisyphus1@optusnet.com.au
> > > Cc: perl5-porters@perl.org
> > > Subject: Re: 5.27.11 fails ../lib/File/Copy.t on linux (ubuntu-16.04) with
> > > -Dusequadmath
> > > 
> > > > > not ok 53 - mtime preserved by copy() while testing cross-partition
> > > > > #   Failed test 'mtime preserved by copy() while testing cross-partition'
> > > > > #   at lib/File/Copy.t line 128.
> > > > > #          got: '1000000000.123449998'
> > > > > #     expected: '1000000000.123449999'
> > > > > 
> > > > > Configure args were '-des -Duse64bitint -Duse64bitall -Dusethreads
> > > > > -Dusequadmath -Dusedevel -Uversiononly'.
> > > > 
> > > > It seems to be an issue with Time::HiRes; that module's
> > > > nanosec-supporting stat() and utimes() calls are in some fashion not
> > > > preserving an exact round-trip mtime. I'm still investigating...
> > > 
> > > If it helps, that test passes when I run that test file (ie the
> > > lib/File/Copy.t that ships with 5.27.11) from perl-5.27.5 and earlier, but
> > > fails when I run it from perl-5.27.6 and later.
> > 
> > I've found it. It's a rounding error (using truncating rather than rounding)
> > I've pushed a fix for smoking as smoke-me/davem/time_hires_nsec.
> > 
> 
> What would be the arguments for Configure needed in that branch?

The important one's -Dusequadmath.

I don't think the bug is limited to qudmath builds, but the particular
combination of floating-point literal stored as a quad float and then
converted to long, tickled the bug, and is the value I used in hte added
test.  I expect specific other time values would trigger the bug on
"normal" builds.

-- 
I before E. Except when it isn't.

Thread Previous


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