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

[perl #133377] lib/File/Copy.t fails mtime test in perl-5.28 builtwith quadmath

Thread Next
From: via RT
August 3, 2018 13:12
[perl #133377] lib/File/Copy.t fails mtime test in perl-5.28 builtwith quadmath
Message ID:
On Wed, 18 Jul 2018 17:46:19 -0700, jkeenan wrote:
> Can we get that branch smoked on platforms that support quadmath?

I see plenty of evidence that the problem still persists.
Was this something that Jarkko was working on prior to the release of perl-5.28.0, before he ran out of time and/or energy ?

I don't have a solution, but I do find the following rather interesting:

Firstly, the test script does:

  my $time = 1000000000.12345;
  utime( $time, $time, "copy-$$" );

If one then immediately checks the value returned by:


one finds that it is exactly equal to $time - 1e-9.

Following on from that, there's a call to:

move("copy-$$", "file-$$")

and if we then immediately check the value returned by:


we find that it is exactly equal to $time - 1e-9 - 1e-9

These aren't simple rounding errors, and I've no idea of (and even less interest in) what the OS is making of all this.
However, something is obviously fundamentally flawed.

One workaround would be to instead set:

$time = 1000000000.123449998;

With that in place, all tests pass.
But, of course, we've then swept a problem under the carpet.

Maybe there should also be a TODO test using the original value of 1000000000.12345 ?

I was curious as to whether the (stat(...))[9] values would change every time the file was moved, but I found that, having arrived at the value of 1000000000.123449998, that's where it remained.


via perlbug:  queue: perl5 status: open

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About