Skip Menu |

This queue is for tickets about the Time-HiRes CPAN distribution.

Report information
The Basics
Id: 114809
Status: resolved
Priority: 0/
Queue: Time-HiRes

People
Owner: Nobody in particular
Requestors: andrew [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.9733
Fixed in: (no value)



Subject: Time::HiRes should override `utime` to allow setting hires access and modification times
This patch adds support for setting higher-precision timestamps via `utime` using futimens for file descriptors and utimensat for files. Tests pass on OpenBSD-current under both perl 5.20.2 and perl 5.22.2. I look forward to critiques as I am my XS skills are pretty new. http://man.openbsd.org/futimens.2
Subject: Time-HiRes-utime-1.9733.patch

Message body is not shown because it is too large.

On Sun May 29 15:41:53 2016, ANDREW wrote: Show quoted text
> This patch adds support for setting higher-precision timestamps via > `utime` using futimens for file descriptors and utimensat for files. > > Tests pass on OpenBSD-current under both perl 5.20.2 and perl 5.22.2. > > I look forward to critiques as I am my XS skills are pretty new.
First round looked pretty good, one small issue: in a system without neither futimens nor utimensat() (OS X) I get a warning: HiRes.c:1886:2: warning: declaration does not declare anything [-Wmissing-declarations] NV; ^~ Looks like the "NV nsec" in the utime() fallback is unused, so I'll remove that. However, some portability issues: IS_SAFE_PATHNAME() seems not be available in some older Perls. I'll look into it. Show quoted text
On Mon Jun 20 07:21:59 2016, JHI wrote: Show quoted text
> On Sun May 29 15:41:53 2016, ANDREW wrote:
> > This patch adds support for setting higher-precision timestamps via > > `utime` using futimens for file descriptors and utimensat for files. > > > > Tests pass on OpenBSD-current under both perl 5.20.2 and perl 5.22.2. > > > > I look forward to critiques as I am my XS skills are pretty new.
> > First round looked pretty good, one small issue: in a system without > neither futimens nor utimensat() > (OS X) I get a warning: > > HiRes.c:1886:2: warning: declaration does not declare anything > [-Wmissing-declarations] > NV; > ^~ > > Looks like the "NV nsec" in the utime() fallback is unused, so I'll > remove that. > > However, some portability issues: IS_SAFE_PATHNAME() seems not be > available in some older Perls. I'll look into it. > >
I'm dubious of this logic: + if (exists $Config{d_hires_utime}) { + $has_utimensat++ if $Config{d_hires_utime}; # Unlikely... and the same for futimens. We should not from the general imply the specific.
Subject: Re: [rt.cpan.org #114809] Time::HiRes should override `utime` to allow setting hires access and modification times
Date: Mon, 20 Jun 2016 06:02:53 -0700
To: Jarkko_Hietaniemi via RT <bug-Time-HiRes [...] rt.cpan.org>
From: Andrew Fresh <andrew [...] afresh1.com>
On Mon, Jun 20, 2016 at 08:11:27AM -0400, Jarkko_Hietaniemi via RT wrote: Show quoted text
> I'm dubious of this logic: > > + if (exists $Config{d_hires_utime}) { > + $has_utimensat++ if $Config{d_hires_utime}; # Unlikely... > > and the same for futimens. We should not from the general imply the specific.
Agreed, I thought I fixed that. Oops! -- andrew - http://afresh1.com Hey, I think I see a barn up ahead. -- The American Astronaut
From: pereira.m [...] gmail.com
On Mon Jun 20 07:21:59 2016, JHI wrote: Show quoted text
> However, some portability issues: IS_SAFE_PATHNAME() seems not be > available in some older Perls. I'll look into it.
Hi, The current workaround for IS_SAFE_PATHNAME (https://metacpan.org/source/JHI/Time-HiRes-1.9735/HiRes.xs#L927) breaks the installation of this module on Centos 6.5 with Perl 5.010001 The problem is related to the use of the Perl_ck_warner function which seems to be unavailable in this version of perl. The relevant excerpts from the complete log (https://gist.githubusercontent.com/MichaelPereira/cf998fb316f2741ce30e5f5cd8a4067e/raw/c9a03e34057d6a51e8008c806850070dc748c598/gistfile1.txt also attached to the message): <Compilation call of HiRes.c> HiRes.xs: In function ‘XS_Time__HiRes_utime’: HiRes.xs:1378: warning: implicit declaration of function ‘Perl_ck_warner’ <In each test compilation> Can't load '/root/.cpanm/work/1466518127.22818/Time-HiRes-1.9735/blib/arch/auto/Time/HiRes/HiRes.so' for module Time::HiRes: /root/.cpanm/work/1466518127.22818/Time-HiRes-1.9735/blib/arch/auto/Time/HiRes/HiRes.so: undefined symbol: Perl_ck_warner at /usr/lib64/perl5/DynaLoader.pm line 200. at t/nanosleep.t line 4 By any chance, would you know of a way to rewrite the problematic line to avoid using this function? Thanks for your help
Subject: Time_Hires_cpan_installation_failure.txt
cpanm (App::cpanminus) 1.7042 on perl 5.010001 built for x86_64-linux-thread-multi Work directory is /root/.cpanm/work/1466518127.22818 You have make /usr/bin/make You have LWP 5.833 You have /bin/tar: tar (GNU tar) 1.23 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by John Gilmore and Jay Fenlason. You have /usr/bin/unzip Searching Time::HiRes () on cpanmetadb ... --> Working on Time::HiRes Fetching http://www.cpan.org/authors/id/J/JH/JHI/Time-HiRes-1.9735.tar.gz -> OK Unpacking Time-HiRes-1.9735.tar.gz Entering Time-HiRes-1.9735 Checking configure dependencies from META.json Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.18) Configuring Time-HiRes-1.9735 Running Makefile.PL Configuring Time::HiRes... Using hints hints/linux.pl... Extra libraries: -lrt... Have syscall()... looking for syscall.h... found <syscall.h>. Looking for gettimeofday()... found. Looking for setitimer()... found. Looking for getitimer()... found. You have interval timers (both setitimer and getitimer). Looking for ualarm()... found. Looking for usleep()... found. Looking for nanosleep()... testing... found. You can mix subsecond sleeps with signals, if you want to. You seem to have stat() subsecond timestamps. (Your struct stat has them, but the filesystems must help.) Checking if your kit is complete... Looks good Generating a Unix-style Makefile Writing Makefile for Time::HiRes Writing MYMETA.yml and MYMETA.json Now you may issue 'make'. Do not forget also 'make test'. -> OK Checking dependencies from MYMETA.json ... Checking if you have strict 0 ... Yes (1.04) Checking if you have Test::More 0.82 ... Yes (1.302022) Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.18) Checking if you have DynaLoader 0 ... Yes (1.10) Checking if you have Config 0 ... Yes (undef) Checking if you have Exporter 0 ... Yes (5.63) Checking if you have Carp 0 ... Yes (1.11) Building and testing Time-HiRes-1.9735 cp HiRes.pm blib/lib/Time/HiRes.pm Running Mkbootstrap for HiRes () chmod 644 "HiRes.bs" "/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- HiRes.bs blib/arch/auto/Time/HiRes/HiRes.bs 644 "/usr/bin/perl" "/usr/share/perl5/ExtUtils/xsubpp" -typemap '/usr/share/perl5/ExtUtils/typemap' -typemap '/root/.cpanm/work/1466518127.22818/Time-HiRes-1.9735/typemap' HiRes.xs > HiRes.xsc mv HiRes.xsc HiRes.c gcc -c -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DVERSION=\"1.9735\" -DXS_VERSION=\"1.9735\" -fPIC "-I/usr/lib64/perl5/CORE" -DTIME_HIRES_NANOSLEEP -DTIME_HIRES_CLOCK_GETTIME -DTIME_HIRES_CLOCK_GETRES -DTIME_HIRES_CLOCK_NANOSLEEP -DTIME_HIRES_CLOCK -DHAS_FUTIMENS -DHAS_UTIMENSAT -DTIME_HIRES_UTIME -DTIME_HIRES_STAT_XTIM -DTIME_HIRES_STAT=4 -DATLEASTFIVEOHOHFIVE HiRes.c HiRes.xs: In function ‘XS_Time__HiRes_utime’: HiRes.xs:1378: warning: implicit declaration of function ‘Perl_ck_warner’ HiRes.c: In function ‘XS_Time__HiRes_constant’: ./const-xs.inc:11: warning: ‘iv’ may be used uninitialized in this function ./const-xs.inc:11: note: ‘iv’ was declared here rm -f blib/arch/auto/Time/HiRes/HiRes.so LD_RUN_PATH="/lib64" gcc -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -o blib/arch/auto/Time/HiRes/HiRes.so HiRes.o \ -lrt \ chmod 755 blib/arch/auto/Time/HiRes/HiRes.so Manifying 1 pod document "/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- HiRes.bs blib/arch/auto/Time/HiRes/HiRes.bs 644 PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/alarm.t ......... ok t/clock.t ......... ok Can't load '/root/.cpanm/work/1466518127.22818/Time-HiRes-1.9735/blib/arch/auto/Time/HiRes/HiRes.so' for module Time::HiRes: /root/.cpanm/work/1466518127.22818/Time-HiRes-1.9735/blib/arch/auto/Time/HiRes/HiRes.so: undefined symbol: Perl_ck_warner at /usr/lib64/perl5/DynaLoader.pm line 200. at t/gettimeofday.t line 4 Compilation failed in require at t/gettimeofday.t line 4. BEGIN failed--compilation aborted at t/gettimeofday.t line 9. t/gettimeofday.t .. Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run Can't load '/root/.cpanm/work/1466518127.22818/Time-HiRes-1.9735/blib/arch/auto/Time/HiRes/HiRes.so' for module Time::HiRes: /root/.cpanm/work/1466518127.22818/Time-HiRes-1.9735/blib/arch/auto/Time/HiRes/HiRes.so: undefined symbol: Perl_ck_warner at /usr/lib64/perl5/DynaLoader.pm line 200. at t/itimer.t line 14 Compilation failed in require at t/itimer.t line 14. BEGIN failed--compilation aborted at t/itimer.t line 26. t/itimer.t ........ Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run Can't load '/root/.cpanm/work/1466518127.22818/Time-HiRes-1.9735/blib/arch/auto/Time/HiRes/HiRes.so' for module Time::HiRes: /root/.cpanm/work/1466518127.22818/Time-HiRes-1.9735/blib/arch/auto/Time/HiRes/HiRes.so: undefined symbol: Perl_ck_warner at /usr/lib64/perl5/DynaLoader.pm line 200. at t/nanosleep.t line 4 Compilation failed in require at t/nanosleep.t line 4. BEGIN failed--compilation aborted at t/nanosleep.t line 9. t/nanosleep.t ..... Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run t/sleep.t ......... ok Can't load '/root/.cpanm/work/1466518127.22818/Time-HiRes-1.9735/blib/arch/auto/Time/HiRes/HiRes.so' for module Time::HiRes: /root/.cpanm/work/1466518127.22818/Time-HiRes-1.9735/blib/arch/auto/Time/HiRes/HiRes.so: undefined symbol: Perl_ck_warner at /usr/lib64/perl5/DynaLoader.pm line 200. at t/stat.t line 4 Compilation failed in require at t/stat.t line 4. BEGIN failed--compilation aborted at t/stat.t line 14. t/stat.t .......... Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run t/time.t .......... ok t/tv_interval.t ... ok Can't load '/root/.cpanm/work/1466518127.22818/Time-HiRes-1.9735/blib/arch/auto/Time/HiRes/HiRes.so' for module Time::HiRes: /root/.cpanm/work/1466518127.22818/Time-HiRes-1.9735/blib/arch/auto/Time/HiRes/HiRes.so: undefined symbol: Perl_ck_warner at /usr/lib64/perl5/DynaLoader.pm line 200. at t/ualarm.t line 4 Compilation failed in require at t/ualarm.t line 4. BEGIN failed--compilation aborted at t/ualarm.t line 9. t/ualarm.t ........ Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run Can't load '/root/.cpanm/work/1466518127.22818/Time-HiRes-1.9735/blib/arch/auto/Time/HiRes/HiRes.so' for module Time::HiRes: /root/.cpanm/work/1466518127.22818/Time-HiRes-1.9735/blib/arch/auto/Time/HiRes/HiRes.so: undefined symbol: Perl_ck_warner at /usr/lib64/perl5/DynaLoader.pm line 200. at t/usleep.t line 4 Compilation failed in require at t/usleep.t line 4. BEGIN failed--compilation aborted at t/usleep.t line 9. t/usleep.t ........ Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run Can't load '/root/.cpanm/work/1466518127.22818/Time-HiRes-1.9735/blib/arch/auto/Time/HiRes/HiRes.so' for module Time::HiRes: /root/.cpanm/work/1466518127.22818/Time-HiRes-1.9735/blib/arch/auto/Time/HiRes/HiRes.so: undefined symbol: Perl_ck_warner at /usr/lib64/perl5/DynaLoader.pm line 200. at t/utime.t line 4 BEGIN failed--compilation aborted at t/utime.t line 9. t/utime.t ......... Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run Test Summary Report ------------------- t/gettimeofday.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output t/itimer.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output t/nanosleep.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output t/stat.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output t/ualarm.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output t/usleep.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output t/utime.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output Files=12, Tests=23, 10 wallclock secs ( 0.04 usr 0.01 sys + 4.56 cusr 0.04 csys = 4.65 CPU) Result: FAIL Failed 7/12 test programs. 0/23 subtests failed. make: *** [test_dynamic] Error 255 -> FAIL Installing Time::HiRes failed. See /root/.cpanm/work/1466518127.22818/build.log for details. Retry with --force to force install it.
Oh, rats. Please try the attached. Note that despite what it is claiming it is not yet the final official Time-HiRes 1.9736. On Tue Jun 21 11:13:33 2016, pereira.m@gmail.com wrote: Show quoted text
> On Mon Jun 20 07:21:59 2016, JHI wrote:
> > However, some portability issues: IS_SAFE_PATHNAME() seems not be > > available in some older Perls. I'll look into it.
> > Hi, > > The current workaround for IS_SAFE_PATHNAME > (https://metacpan.org/source/JHI/Time-HiRes-1.9735/HiRes.xs#L927) > breaks the installation of this module on Centos 6.5 with Perl > 5.010001 > > The problem is related to the use of the Perl_ck_warner function which > seems to be unavailable in this version of perl. > > The relevant excerpts from the complete log > (https://gist.githubusercontent.com/MichaelPereira/cf998fb316f2741ce30e5f5cd8a4067e/raw/c9a03e34057d6a51e8008c806850070dc748c598/gistfile1.txt > also attached to the message): > > <Compilation call of HiRes.c> > HiRes.xs: In function ‘XS_Time__HiRes_utime’: > HiRes.xs:1378: warning: implicit declaration of function > ‘Perl_ck_warner’ > > <In each test compilation> > Can't load '/root/.cpanm/work/1466518127.22818/Time-HiRes- > 1.9735/blib/arch/auto/Time/HiRes/HiRes.so' for module Time::HiRes: > /root/.cpanm/work/1466518127.22818/Time-HiRes- > 1.9735/blib/arch/auto/Time/HiRes/HiRes.so: undefined symbol: > Perl_ck_warner at /usr/lib64/perl5/DynaLoader.pm line 200. > at t/nanosleep.t line 4 > > By any chance, would you know of a way to rewrite the problematic line > to avoid using this function? > > Thanks for your help
Subject: Time-HiRes-1.9736.tar.gz
Download Time-HiRes-1.9736.tar.gz
application/x-gzip 91.6k

Message body not shown because it is not plain text.

From: pereira.m [...] gmail.com
On Tue Jun 21 19:45:05 2016, JHI wrote: Show quoted text
> Oh, rats. Please try the attached. Note that despite what it is > claiming it is not yet the final official Time-HiRes 1.9736.
Hi JHI, Thanks for the quick reply time. Unfortunately I am still getting the same error. The reason is that contrary to what is being shown at the top of the error log: Show quoted text
> cpanm (App::cpanminus) 1.7042 on perl 5.010001 built for x86_64-linux-thread-multi
The version of perl installed on the system is: Show quoted text
>[root@centos65-test-8 Time-HiRes-1.9736]# perl --version > >This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi
In the modified #ifndef, I can get it to work by replacing the PERL_VERSION check from 10 to 11: [root@centos65-test-8 Time-HiRes-1.9736]# diff HiRes.c.1.9736 HiRes.c 940c940 < #if PERL_VERSION >= 10 /* Perl_ck_warner is 5.10.0 -> */ --- Show quoted text
> #if PERL_VERSION >= 11 /* Perl_ck_warner is 5.11.0 -> */
But I am unable to find in which version exactly was Perk_ck_warner introduced, so I'm not sure if this is going to work for people with Perl 5.11. With the modified check, the rest of the setup runs correctly in my case. Thanks again, Michael
Subject: ifndef_perl_ck_warner.patch
940c940 < #if PERL_VERSION >= 10 /* Perl_ck_warner is 5.10.0 -> */ --- > #if PERL_VERSION >= 11 /* Perl_ck_warner is 5.11.0 -> */
Subject: Re: [rt.cpan.org #114809] Time::HiRes should override `utime` to allow setting hires access and modification times
Date: Wed, 22 Jun 2016 13:27:07 -0400
To: bug-Time-HiRes [...] rt.cpan.org
From: Jarkko Hietaniemi <jhi [...] iki.fi>
On Wednesday-201606-22 11:35, pereira.m@gmail.com via RT wrote: Show quoted text
> Thanks for the quick reply time. Unfortunately I am still getting the same error. The reason is that contrary to what is being shown at the top of the error log: >
>> > cpanm (App::cpanminus) 1.7042 on perl 5.010001 built for x86_64-linux-thread-multi
> The version of perl installed on the system is: >
That is strange. At least according to the perl source code archive of Perl 5.10.0 Perl_ck_warner was available in that version. And this: "perl 5.010001" does mean 5.10.1, it's well-defined that way: (a + b / 1000 + c / 1000000)
From: pereira.m [...] gmail.com
I confirm that everything is good with Time-HiRes-1.9739. Thanks a lot for the changes