Skip Menu |
Report information
Id: 131976
Status: open
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: ishigaki <ishigaki [at] cpan.org>
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type: library
Perl Version: 5.27.3
Fixed In: (no value)



Subject: Module::CoreList::is_core("File::Spec::AmigaOS", "3.64") dies
From: ishigaki [...] cpan.org
Date: Mon, 28 Aug 2017 14:54:21 +0900 (JST)
To: perlbug [...] perl.org
CC: ishigaki [...] cpan.org
Download (untitled) / with headers
text/plain 3.5k
This is a bug report for perl from ishigaki@cpan.org, generated with the help of perlbug 1.40 running under perl 5.27.3. ----------------------------------------------------------------- [Please describe your issue here] perl -MModule::CoreList -E 'say Module::CoreList::is_core("File::Spec::AmigaOS", "3.64")' dies, saying "Invalid version format (version required)", because of an invalid version (;.64) for 5.023009. [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=library severity=low module=Module::CoreList --- Site configuration information for perl 5.27.3: Configured by ishigaki at Mon Aug 28 14:36:22 JST 2017. Summary of my perl5 (revision 5 version 27 subversion 3) configuration: Platform: osname=linux osvers=3.16.0-4-amd64 archname=x86_64-linux uname='linux charsbar.org 3.16.0-4-amd64 #1 smp debian 3.16.39-1 (2016-12-30) x86_64 gnulinux ' config_args='-Dprefix=/home/ishigaki/.plenv/versions/5.27.3 -de -Dusedevel -A'eval:scriptdir=/home/ishigaki/.plenv/versions/5.27.3/bin'' hint=recommended useposix=true d_sigaction=define useithreads=undef usemultiplicity=undef use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n default_inc_excludes_dot=define bincompat5005=undef Compiler: cc='cc' ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2' optimize='-O2' cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include' ccversion='' gccversion='4.9.2' gccosandvers='' intsize=4 longsize=8 ptrsize=8 doublesize=8 byteorder=12345678 doublekind=3 d_longlong=define longlongsize=8 d_longdbl=define longdblsize=16 longdblkind=3 ivtype='long' ivsize=8 nvtype='double' nvsize=8 Off_t='off_t' lseeksize=8 alignbytes=8 prototype=define Linker and Libraries: ld='cc' ldflags =' -fstack-protector-strong -L/usr/local/lib' libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib libs=-lpthread -lnsl -ldb -ldl -lm -lcrypt -lutil -lc perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc libc=libc-2.19.so so=so useshrplib=false libperl=libperl.a gnulibc_version='2.19' Dynamic Linking: dlsrc=dl_dlopen.xs dlext=so d_dlsymun=undef ccdlflags='-Wl,-E' cccdlflags='-fPIC' lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong' Locally applied patches: Devel::PatchPerl 1.48 --- @INC for perl 5.27.3: /home/ishigaki/.plenv/versions/5.27.3/lib/perl5/site_perl/5.27.3/x86_64-linux /home/ishigaki/.plenv/versions/5.27.3/lib/perl5/site_perl/5.27.3 /home/ishigaki/.plenv/versions/5.27.3/lib/perl5/5.27.3/x86_64-linux /home/ishigaki/.plenv/versions/5.27.3/lib/perl5/5.27.3 --- Environment for perl 5.27.3: HOME=/home/ishigaki LANG=en_US.UTF-8 LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/ishigaki/.plenv/versions/5.27.3/bin:/home/ishigaki/.plenv/libexec:/home/ishigaki/.plenv/plugins/perl-build/bin:/home/ishigaki/.rakudobrew/bin:/home/ishigaki/.rbenv/shims:/home/ishigaki/.rbenv/bin:/home/ishigaki/.plenv/shims:/home/ishigaki/.plenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games PERL_BADLANG (unset) SHELL=/bin/bash
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.4k
On Mon, 28 Aug 2017 06:02:02 GMT, ishigaki wrote: Show quoted text
> > This is a bug report for perl from ishigaki@cpan.org, > generated with the help of perlbug 1.40 running under perl 5.27.3. > > > ----------------------------------------------------------------- > [Please describe your issue here] > > perl -MModule::CoreList -E 'say > Module::CoreList::is_core("File::Spec::AmigaOS", "3.64")' dies, saying > "Invalid version format (version required)", because of an invalid > version (;.64) for 5.023009. > >
This is probably a side-effect from a problem previously corrected. ##### $ git show b10f34 | cat commit b10f34abb55ae2504baa9b770b3bff979de781c2 Author: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Date: Tue Mar 22 21:07:38 2016 +0000 [perl #127765] Fix bogus $File::Spec::AmigaOS::VERSION ';' a single bitflip away from '3', which must have happened before e46aa1dd got committed, since the SHA-1 hashes are all consistent. diff --git a/dist/PathTools/lib/File/Spec/AmigaOS.pm b/dist/PathTools/lib/File/Spec/AmigaOS.pm index 9182d5e..7a5889c 100644 --- a/dist/PathTools/lib/File/Spec/AmigaOS.pm +++ b/dist/PathTools/lib/File/Spec/AmigaOS.pm @@ -4,7 +4,7 @@ use strict; use vars qw(@ISA $VERSION); require File::Spec::Unix; -$VERSION = ';.64'; +$VERSION = '3.64'; $VERSION =~ tr/_//d; @ISA = qw(File::Spec::Unix); ##### I don't know enough about Module::CoreList::is_core() to know whether this is easily fixable. Thank you very much. -- James E Keenan (jkeenan@cpan.org)
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.7k
On Mon, 28 Aug 2017 15:44:49 GMT, jkeenan wrote: Show quoted text
> On Mon, 28 Aug 2017 06:02:02 GMT, ishigaki wrote:
> > > > This is a bug report for perl from ishigaki@cpan.org, > > generated with the help of perlbug 1.40 running under perl 5.27.3. > > > > > > ----------------------------------------------------------------- > > [Please describe your issue here] > > > > perl -MModule::CoreList -E 'say > > Module::CoreList::is_core("File::Spec::AmigaOS", "3.64")' dies, > > saying > > "Invalid version format (version required)", because of an invalid > > version (;.64) for 5.023009. > > > >
> > This is probably a side-effect from a problem previously corrected. > > ##### > $ git show b10f34 | cat > commit b10f34abb55ae2504baa9b770b3bff979de781c2 > Author: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> > Date: Tue Mar 22 21:07:38 2016 +0000 > > [perl #127765] Fix bogus $File::Spec::AmigaOS::VERSION > > ';' a single bitflip away from '3', which must have happened before > e46aa1dd got committed, since the SHA-1 hashes are all consistent. > > diff --git a/dist/PathTools/lib/File/Spec/AmigaOS.pm > b/dist/PathTools/lib/File/Spec/AmigaOS.pm > index 9182d5e..7a5889c 100644 > --- a/dist/PathTools/lib/File/Spec/AmigaOS.pm > +++ b/dist/PathTools/lib/File/Spec/AmigaOS.pm > @@ -4,7 +4,7 @@ use strict; > use vars qw(@ISA $VERSION); > require File::Spec::Unix; > > -$VERSION = ';.64'; > +$VERSION = '3.64'; > $VERSION =~ tr/_//d; > > @ISA = qw(File::Spec::Unix); > ##### > > I don't know enough about Module::CoreList::is_core() to know whether > this is easily fixable. > > Thank you very much.
The patch attached corrects the problem -- but since I've made mistakes with Module-CoreList patches in the past, I'd like to have it reviewed first. Thank you very much. -- James E Keenan (jkeenan@cpan.org)
Subject: 0001-Correct-badly-formatted-version-number.patch
From 2c7c30d106222420e0e302b777edc8a263d939b3 Mon Sep 17 00:00:00 2001 From: James E Keenan <jkeenan@cpan.org> Date: Mon, 28 Aug 2017 11:58:28 -0400 Subject: [PATCH] Correct badly formatted version number. https://rt.perl.org/Ticket/Display.html?id=131976 --- dist/Module-CoreList/lib/Module/CoreList.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/Module-CoreList/lib/Module/CoreList.pm b/dist/Module-CoreList/lib/Module/CoreList.pm index 24bd67f..d2cf349 100644 --- a/dist/Module-CoreList/lib/Module/CoreList.pm +++ b/dist/Module-CoreList/lib/Module/CoreList.pm @@ -12349,7 +12349,7 @@ for my $version ( sort { $a <=> $b } keys %released ) { 'ExtUtils::Embed' => '1.33', 'File::Find' => '1.34', 'File::Glob' => '1.26', - 'File::Spec::AmigaOS' => ';.64', + 'File::Spec::AmigaOS' => '3.64', 'IPC::Msg' => '2.06_01', 'IPC::Semaphore' => '2.06_01', 'IPC::SharedMem' => '2.06_01', -- 2.7.4
To: perlbug-followup [...] perl.org
Date: Tue, 29 Aug 2017 14:49:17 +0100
From: ilmari [...] ilmari.org (Dagfinn Ilmari Mannsåker)
Subject: Re: [perl #131976] Module::CoreList::is_core("File::Spec::AmigaOS", "3.64") dies
Download (untitled) / with headers
text/plain 3.6k
"James E Keenan via RT" <perlbug-followup@perl.org> writes: Show quoted text
> On Mon, 28 Aug 2017 15:44:49 GMT, jkeenan wrote:
>> On Mon, 28 Aug 2017 06:02:02 GMT, ishigaki wrote:
>> > >> > This is a bug report for perl from ishigaki@cpan.org, >> > generated with the help of perlbug 1.40 running under perl 5.27.3. >> > >> > >> > ----------------------------------------------------------------- >> > [Please describe your issue here] >> > >> > perl -MModule::CoreList -E 'say >> > Module::CoreList::is_core("File::Spec::AmigaOS", "3.64")' dies, >> > saying >> > "Invalid version format (version required)", because of an invalid >> > version (;.64) for 5.023009. >> > >> >
>> >> This is probably a side-effect from a problem previously corrected. >> >> ##### >> $ git show b10f34 | cat >> commit b10f34abb55ae2504baa9b770b3bff979de781c2 >> Author: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> >> Date: Tue Mar 22 21:07:38 2016 +0000 >> >> [perl #127765] Fix bogus $File::Spec::AmigaOS::VERSION >> >> ';' a single bitflip away from '3', which must have happened before >> e46aa1dd got committed, since the SHA-1 hashes are all consistent. >> >> diff --git a/dist/PathTools/lib/File/Spec/AmigaOS.pm >> b/dist/PathTools/lib/File/Spec/AmigaOS.pm >> index 9182d5e..7a5889c 100644 >> --- a/dist/PathTools/lib/File/Spec/AmigaOS.pm >> +++ b/dist/PathTools/lib/File/Spec/AmigaOS.pm >> @@ -4,7 +4,7 @@ use strict; >> use vars qw(@ISA $VERSION); >> require File::Spec::Unix; >> >> -$VERSION = ';.64'; >> +$VERSION = '3.64'; >> $VERSION =~ tr/_//d; >> >> @ISA = qw(File::Spec::Unix); >> ##### >> >> I don't know enough about Module::CoreList::is_core() to know whether >> this is easily fixable. >> >> Thank you very much.
> > The patch attached corrects the problem -- but since I've made mistakes > with Module-CoreList patches in the past, I'd like to have it reviewed > first. > > Thank you very much. > > -- > James E Keenan (jkeenan@cpan.org) > > --- > via perlbug: queue: perl5 status: open > https://rt.perl.org/Ticket/Display.html?id=131976 > From 2c7c30d106222420e0e302b777edc8a263d939b3 Mon Sep 17 00:00:00 2001 > From: James E Keenan <jkeenan@cpan.org> > Date: Mon, 28 Aug 2017 11:58:28 -0400 > Subject: [PATCH] Correct badly formatted version number. > > https://rt.perl.org/Ticket/Display.html?id=131976 > --- > dist/Module-CoreList/lib/Module/CoreList.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/dist/Module-CoreList/lib/Module/CoreList.pm b/dist/Module-CoreList/lib/Module/CoreList.pm > index 24bd67f..d2cf349 100644 > --- a/dist/Module-CoreList/lib/Module/CoreList.pm > +++ b/dist/Module-CoreList/lib/Module/CoreList.pm > @@ -12349,7 +12349,7 @@ for my $version ( sort { $a <=> $b } keys %released ) { > 'ExtUtils::Embed' => '1.33', > 'File::Find' => '1.34', > 'File::Glob' => '1.26', > - 'File::Spec::AmigaOS' => ';.64', > + 'File::Spec::AmigaOS' => '3.64', > 'IPC::Msg' => '2.06_01', > 'IPC::Semaphore' => '2.06_01', > 'IPC::SharedMem' => '2.06_01',
While that fixes the immediate problem, it also causes Module::CoreList to lie: 5.23.9 _did_ ship File::Spec::AmigaOS with that broken version number. An alternative patch would be to make is_core() more robust against version parsing errors, à la the attached patch. This has the additional benefit of only parsing the user-provided version once, and reporting errors in it separately. -- "The surreality of the universe tends towards a maximum" -- Skud's Law "Never formulate a law or axiom that you're not prepared to live with the consequences of." -- Skud's Meta-Law
diff --git a/dist/Module-CoreList/lib/Module/CoreList.pm b/dist/Module-CoreList/lib/Module/CoreList.pm index 24bd67f9ef..9cc7c3dee9 100644 --- a/dist/Module-CoreList/lib/Module/CoreList.pm +++ b/dist/Module-CoreList/lib/Module/CoreList.pm @@ -14442,6 +14442,11 @@ sub is_core # On the way if we pass the required module version, we can # short-circuit and return true if (defined($module_version)) { + my $module_version_object = eval { version->parse($module_version) }; + if (!defined($module_version_object)) { + (my $err = $@) =~ s/^Invalid version format /Invalid version '$module_version' specified /; + die $err; + } # The Perl releases aren't a linear sequence, but a tree. We need to build the path # of releases from 5 to the specified release, and follow the module's version(s) # along that path. @@ -14459,7 +14464,7 @@ sub is_core last RELEASE if $prn > $perl_version; next unless defined(my $next_module_version = $delta{$prn}->{changed}->{$module}); - return 1 if version->parse($next_module_version) >= version->parse($module_version); + return 1 if eval { version->parse($next_module_version) >= $module_version_object }; } return 0; }


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org