Intrepid has asked for the wisdom of the Perl Monks concerning the following question:

This time I'll put the question first: "How worried should I be?" I set up a build of the most recent Debian archive of stable perl (v5.40.1) and saw the following failures in Time::HiRes:

cwd: ~/build/perl/perl-debian-5.40/t
Ran shell command:
   ./perl harness 2>&1 | egrep --color -i -e 'Fail' -
Got output:

-------------------------------------
# Failed test 'atime set correctly'
# Failed test 'mtime set correctly'
# Failed test 'atime set correctly'
# Failed test 'mtime set correctly'
# Failed test 'File 1 atime set correctly'
# Failed test 'File 1 mtime set correctly'
# Failed test 'File 2 atime set correctly'
# Failed test 'File 2 mtime set correctly'
# Looks like you failed 8 tests of 22.
Failed 8/22 subtests
../dist/Time-HiRes/t/utime.t (Wstat: 2048 (exited 8) Tests: 22 Failed: 8)
Failed tests: 2-3, 5-6, 12-15
-------------------------------------

Perl release v5.40.1
Module packed with Perl: Time::HiRes v1.9777
Linux version 6.1.0-12-686
Debian 6.1.52-1 (2023-09-07)

I looked at http://matrix.cpantesters.org/ but I haven't learned to interpret the test matrix yet (I'm pleading ignorance when really I am probably just too distracted right now).

Mar 05, 2025 at 02:47 UTC

A just machine to make big decisions
Programmed by fellows (and gals) with compassion and vision
We'll be clean when their work is done
We'll be eternally free yes, and eternally young
Donald Fagen —> I.G.Y.
(Slightly modified for inclusiveness)

  • Comment on Perl release v5.40.1 on a 32-bit box showing failed tests for atime and ctime in Time::HiRes
  • Download Code

Replies are listed 'Best First'.
Re: Perl release v5.40.1 on a 32-bit box showing failed tests for atime and ctime in Time::HiRes
by cavac (Prior) on Mar 05, 2025 at 13:57 UTC

    You should be worried about more than Time::HiRes. Although the module shouldn't fail, you have potentially bigger problems:

    • You seem to be using Debian 6 "Squeeze". Long-term support for that ended in 2014 (ten years ago) if Wikipedia is to be trusted. That potentially means you are missing a decade of security bugfixes.
    • You are using a 32bit operating system. These have all kinds of limitations. Including that your OS (or major libraries installed in it) potentially still use 32bit timestamps. Or use a mix of 32/64 bit timestamps, which certainly could explain some of the problems if your filesystem timestamp bitsize mismatches Perl.
    • It seems even the Debian maintainers are thinking of sunsetting 32bit distros.

    As for me, i can't even test Time::HiRes on a 32 bit system anymore, because i have upgraded the last one more than a decade ago. I might have some ancient Raspberry PI around in some spare parts box that i could potentially get running again. But this bug might be processor/file system specific. What filesystem are you running on?

    PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
    Also check out my sisters artwork and my weekly webcomics

      Hi cavac, thanks for the reply. You raised good questions. I'd like to get a couple more years use out of this laptop but I see that I could run into problems.

      You wrote:
        >You are using a 32bit operating system. These have all kinds of limitations. Including that your OS (or major libraries installed in it) potentially still use 32bit timestamps. Or use a mix of 32/64 bit timestamps, which certainly could explain some of the problems if your filesystem timestamp bitsize mismatches Perl.

      It's a bit strange because I similarly "renovated" an older laptop a few months ago with a fresh OS install (the last Debian available for 32-bit machines, 4.19) and didn't see any test failures like these when I built perl and modules, that machine runs a 32-bit AMD processor and the machine in question here runs an Intel i5.

        >What filesystem are you running on?

      I'm using the ext4 filesystem.

      Although probably based on Squeeze as you say, this machine actually got Linux Mint (LMDE) installed on it. Mint seems to be supporting 32-bit boxes long than Debian themselves.

      Thanks again for your time and attention and suggestions.

      Mar 05, 2025 at 19:46 UTC

        Is this laptop running a 32bit-only processor? How old is it?

        I have a 14 to 15 year old laptop around that i still occasionally use. I run Xubuntu 22.04 LTS (64 bit) on it and it performs reasonably well. For me, the thing that makes modern Linux on older hardware work is selecting a Desktop environment that uses few resources but still has all the modern convenience. In my case, that's XFCE. It's highly configurable, and it got a decent terminal emulator (and if you need a high performance terminal, xterm is a good choice, at least for me terminal graphics demos).

        I'd recommend trying to run a few 64 bit Linux distris as live system from an USB stick to see if they boot. (X)Ubuntu also has a settings program usually called "Additional drivers" that, so far, hasn't let me down when it comes to supporting graphics cards.

        PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
        Also check out my sisters artwork and my weekly webcomics
Re: Perl release v5.40.1 on a 32-bit box showing failed tests for atime and ctime in Time::HiRes
by tonyc (Hermit) on Mar 05, 2025 at 22:43 UTC

    Perl (including Time::HiRES) is regularly tested against a 32-bit Linux userland, and Debian still provide 32-bit installation images.

    That Debian version number looks strange, I only ever recall seeing major.minor versions for Debian. If it is Debian you should have a /etc/debian_version file with the release number.

    You can run just the failing test with:

    ./perl harness -v ../dist/Time-HiRes/t/utime.t

    which may provide some clues as to what's going on.

    You say you're using the latest Debian archive, do you see the same failure if you build from the origin perl 5.40.1 sources?

      Hey tonyc. Thanks, you taught me something. I ran ./perl harness -v ../dist/Time-HiRes/t/utime.t and the output (trimmed out a little bit of non-relevant stuff for readability):

      ../dist/Time-HiRes/t/utime.t .. 
      
      # Testing for subsecond file timestamps (mtime) in /home/somian/build/perl/perl-debian-5.40/dist/Time-HiRes
      # Subsecond file timestamps in /home/somian/build/perl/perl-debian-5.40/dist/Time-HiRes: OK
      1..22
      # $^O = linux, atime = 1.111111111, mtime = 2.222222222
      # utime $fh
      ok 1 - One file changed
      not ok 2 - atime set correctly
      
      #   Failed test 'atime set correctly'
      #   at t/utime.t line 156.
      #          got: '1'
      #     expected: '1.111111111'
      not ok 3 - mtime set correctly
      
      #   Failed test 'mtime set correctly'
      #   at t/utime.t line 158.
      #          got: '2'
      #     expected: '2.222222222'
      #utime $filename
      ok 4 - One file changed
      not ok 5 - atime set correctly
      
      #   Failed test 'atime set correctly'
      #   at t/utime.t line 168.
      #          got: '1'
      #     expected: '1.111111111'
      not ok 6 - mtime set correctly
      
      #   Failed test 'mtime set correctly'
      #   at t/utime.t line 170.
      #          got: '2'
      #     expected: '2.222222222'
      #utime $filename round-trip
      ok 7 - One file changed
      ok 8 - One file changed
      ok 9 - atime round trip ok
      ok 10 - mtime round trip ok
      utime $filename and $fh
      ok 11 - Two files changed
      not ok 12 - File 1 atime set correctly
      
      #   Failed test 'File 1 atime set correctly'
      #   at t/utime.t line 195.
      #          got: '1'
      #     expected: '1.111111111'
      not ok 13 - File 1 mtime set correctly
      
      #   Failed test 'File 1 mtime set correctly'
      #   at t/utime.t line 197.
      #          got: '2'
      #     expected: '2.222222222'
      not ok 14 - File 2 atime set correctly
      
      #   Failed test 'File 2 atime set correctly'
      #   at t/utime.t line 203.
      #          got: '1'
      #     expected: '1.111111111'
      not ok 15 - File 2 mtime set correctly
      
      #   Failed test 'File 2 mtime set correctly'
      #   at t/utime.t line 205.
      #          got: '2'
      #     expected: '2.222222222'
      # utime undef sets time to now
      ok 16 - Two files changed
      ok 17 - File 1 atime set correctly
      ok 18 - File 1 mtime set correctly
      ok 19 - File 2 atime set correctly
      ok 20 - File 2 mtime set correctly
      # negative atime dies
      ok 21 - negative time error
      # negative mtime dies;
      ok 22 - negative time error
      # Looks like you failed 8 tests of 22.
      Dubious, test returned 8 (wstat 2048, 0x800)
      Failed 8/22 subtests 
      
      Test Summary Report
      -------------------
      ../dist/Time-HiRes/t/utime.t (Wstat: 2048 (exited 8) Tests: 22 Failed: 8)
        Failed tests:  2-3, 5-6, 12-15
        Non-zero exit status: 8
      Files=1, Tests=22,  1 wallclock secs ( 0.02 usr  0.01 sys +  0.22 cusr  0.03 csys =  0.28 CPU)
      Result: FAIL
      Finished test run at Thu Mar  6 13:54:43 2025.
      

      It seems that the test code expected floats but got integers.

      WRT the version of Debian I am running, I derived the version I reported in my post from the output of cat /proc/version, but the /etc/debian_version file contains 12.1. Hope that clarifies things.

      Thanks again.

      Mar 06, 2025 at 19:54 UTC

        From your other comment you're using ext4, so I'd expect the file system to support sub-second timestamps, if you do:

        # this is a command-line command, not perl code stat .

        does it show sub-second timestamps, eg. I get

        $ stat . File: . Size: 20480 Blocks: 40 IO Block: 4096 directory Device: 253,2 Inode: 33079540 Links: 26 Access: (0755/drwxr-xr-x) Uid: ( 1000/ tony) Gid: ( 1000/ ton +y) Access: 2025-03-10 07:39:22.352732987 +1100 Modify: 2025-03-06 15:07:42.145467132 +1100 Change: 2025-03-06 15:07:42.145467132 +1100 Birth: 2022-08-08 15:04:51.515950529 +1000