Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Polite way to ask status of bug regarding Time::HiRes and newer versions of Perl

by 1nickt (Abbot)
on May 02, 2018 at 17:58 UTC ( #1213965=note: print w/replies, xml ) Need Help??


in reply to Polite way to ask status of bug regarding Time::HiRes and newer versions of Perl

Hi, you don't say so, but I assume you are building a threaded perl since that's where the problem occurs. Note that there are no issues with non-threaded perls.

The definitive story seems to be buried in that thread:

Versions of OS X prior to Sierra do not provide the functions clock_getres(), clock_gettime(), clock_nanosleep() and consequently versions of Time::HiRes prior to 1.9729 just disabled this functionality. perl5.22 @5.22.3 has 1.9726 so passes the test.

Time::HiRes 1.9729 then implemented emulation of clock_getres(), clock_gettime(), clock_nanosleep() on OS X platforms as an enhancement

Sierra however introduced clock_getres(), clock_gettime() but not clock_nanosleep() which broke the 1.9729 emulation code. This was fixed in Time::HiRes 1.9739 but perl5.24 @5.24.1 has 1.9733 so fails on Sierra.

perl5.25 @5.25.9 has 1.9741 with this Sierra fix (and a few others for Sierra and El Capitan) so passes the test.

So if you just make sure to install Time::HiRes >= v1.9741, you should be OK. Current version in CPAN is 1.9758. (Note that Time::HiRes is a so-called "dual-life" module that exists in Core and also standalone on CPAN. In such cases the CPAN version is usually more recent.)

I'm building a threaded perl now so I can test this, will report back. Will you too, please?

Hope this helps!


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^2: Polite way to ask status of bug regarding Time::HiRes and newer versions of Perl
by 1nickt (Abbot) on May 02, 2018 at 18:19 UTC

    Well, interestingly clock.t passes but now a different test fails, and sadly it is the same test that fails on the attempted Core Time::HiRes install, stat.t:

    ~/.cpanm/latest-build/Time-HiRes-1.9758 $ prove -lrv t/stat.t t/stat.t .. 1..43 # I am the main process 31657, starting the watchdog process... # The watchdog process 31658 launched, continuing testing... # I am the watchdog process 31658, sleeping for 360 seconds... ok 1 ok 2 ok 3 ok 4 ok 5 ok 6 ok 7 ok 8 ok 9 ok 10 ok 11 ok 12 not ok 13 # Failed test at t/stat.t line 35. # Structures begin differing at: # $got->[8] = '1525284927' # $expected->[8] = '1525284926' ok 14 ok 15 ok 16 ok 17 ok 18 ok 19 ok 20 ok 21 ok 22 ok 23 ok 24 ok 25 ok 26 ok 27 ok 28 ok 29 ok 30 ok 31 ok 32 ok 33 ok 34 ok 35 # mtime = 1525284926 1525284927 1525284927 1525284927 1525284927 # atime = 1525284926 1525284927 1525284927 1525284927 1525284928 # ai = 4, mi = 4, ss = 0 ok 36 # skip no subsecond timestamps detected ok 37 ok 38 ok 39 ok 40 ok 41 ok 42 ok 43 # I am the main process 31657, terminating the watchdog process 31658 +before it terminates me in 358 seconds (testing took 2 seconds). # kill KILL 31658 = 1 # All done. # Looks like you failed 1 test of 43. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/43 subtests (less 1 skipped subtest: 41 okay) Test Summary Report ------------------- t/stat.t (Wstat: 256 Tests: 43 Failed: 1) Failed test: 13 Non-zero exit status: 1 Files=1, Tests=43, 2 wallclock secs ( 0.03 usr 0.00 sys + 0.05 cusr + 0.01 csys = 0.09 CPU) Result: FAIL

    I guess the only thing left to try is 5.25.9 which according to that thread is patched.

    The way forward always starts with a minimal test.
Re^2: Polite way to ask status of bug regarding Time::HiRes and newer versions of Perl
by jimhallsun (Sexton) on May 02, 2018 at 18:24 UTC

    I am not building a threaded perl. Here is the relevant snippet from the perlbrew log:

    <snippet>

    Getting the current patchlevel... (You have perl5 version 24 subversion 4.)

    Perl can be built to offer a form of threading support on some systems To do so, Configure can be run with -Dusethreads.

    Note that Perl built with threading support runs slightly slower and uses slightly more memory than plain Perl.

    If this doesn't make any sense to you, just accept the default 'n'. Build a threading Perl? n

    </snippet>

    But there are sections of the build log that state the configure script is finding -lpthread and such....

    I am running macOS High Sierra 10.13.4, which I think is the latest.

      Hi there, if you are not building a threaded perl then I don't think you linked to the relevant issue. This seems to be an issue with stat.t which is thus far unreported.

      I note that on Sierra also, with an unthreaded 5.26.1, the latest Time::HiRes fails to install, as does the one installed as the Core version (1.9741) when I try to reinstall it from CPAN. Very odd. It obviously installed correctly when I built my perl(s). Given that, you might simply try building Perl 5.26.1 as your next attempt.

      Hope this helps!

      PS I guess CPAN Testers needs more Mac OS test reports, see App::Cpanminus::reporter.

      PPS I guess this is an intermittent issue; I am able to install Time::HiRes 1.9758 successfully on 5.26.1 about half the time.

      PPPS Given that it's intermittent, I would be wary of trusting Time::HiRes for accuracy. Maybe the issue is that it's just blocking your Perl install, in which case you could almost ignore it, or maybe it's critical to you, in which case you might have to install a Linux VM on your Macbook, I guess :-(


      The way forward always starts with a minimal test.

        Yes - I think something is up here (macOS & Time::HiRes) in general. Assuming there is no one to notify regarding the issues(s), I will just slink back to my Solaris install till this gets addressed! I may try to force the install of perl and then layer a newer version of Time::HiRes...

        Thanks for taking a look!

      Is there someone we should let know? Or do you think this will just sort in a reasonable amount of time?

        Apologies I did not cite the root bug, but where the discussion about incorporating the fix was elaborated on. For completeness here is the actual source bug that does not involve threaded perl:

        https://rt.perl.org/Public/Bug/Display.html?id=128972

        This bug is a match for me. I have not hit the bug you are seeing yet. So I should not file.

        Last question: for your bug - did you upgrade Time::HiRes prior to building perl? Trying to confirm that is how I should do things with perlbrew.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1213965]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2020-04-10 10:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The most amusing oxymoron is:
















    Results (49 votes). Check out past polls.

    Notices?