Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version->parse missing mg_get #12541

Closed
p5pRT opened this issue Nov 9, 2012 · 8 comments
Closed

version->parse missing mg_get #12541

p5pRT opened this issue Nov 9, 2012 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented Nov 9, 2012

Migrated from rt.perl.org#115660 (status was 'resolved')

Searchable as RT115660$

@p5pRT
Copy link
Author

p5pRT commented Nov 9, 2012

From @ikegami

Created by @ikegami

version->parse (which is to say XS_version_new in universal.c) doesn't call
mg_get before checking if its argument is defined as it should.

  $ perl -Mversion -E'
  "v1.00" =~ /v(.+)/ or die;
  $x=$1 if $ARGV[0];
  say version->parse($1);
  ' 0
  0

  $ perl -Mversion -e'
  "v1.00" =~ /v(.+)/ or die;
  $x=$1 if $ARGV[0];
  say version->parse($1);
  ' 1
  1.00

Workaroud​:

  $ perl -Mversion -E'
  "v1.00" =~ /v(.+)/ or die;
  say version->parse("$1");
  '
  1.00

Perl Info

Flags:
    category=library
    severity=low
    module=version

Site configuration information for perl 5.16.1:

Configured by gecko at Thu Aug 30 20:04:55 2012.

Summary of my perl5 (revision 5 version 16 subversion 1) configuration:

  Platform:
    osname=MSWin32, osvers=5.2, archname=MSWin32-x86-multi-thread
    uname=''
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cl', ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32
-D_CONSOLE -DNO_STRICT -DPERL_TEXTMODE_SCRIPTS -DUSE_SITECUSTOMIZE
-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO
-D_USE_32BIT_TIME_T',
    optimize='-MD -Zi -DNDEBUG -O1',
    cppflags='-DWIN32'
    ccversion='16.0.40219', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64',
lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf
-libpath:"C:\Progs\perl5161-ap1601\lib\CORE"  -machine:x86'
    libpth=\lib
    libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib
uuid.lib ws2_32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib
comctl32.lib msvcrt.lib
    perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib  netapi32.lib
uuid.lib ws2_32.lib mpr.lib winmm.lib  version.lib odbc32.lib odbccp32.lib
comctl32.lib msvcrt.lib
    libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl516.lib
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug
-opt:ref,icf  -libpath:"C:\Progs\perl5161-ap1601\lib\CORE"  -machine:x86'

Locally applied patches:
    ACTIVEPERL_LOCAL_PATCHES_ENTRY


@INC for perl 5.16.1:
    C:/Progs/perl5161-ap1601/site/lib
    C:/Progs/perl5161-ap1601/lib
    .


Environment for perl 5.16.1:
    HOME (unset)
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=c:\Program Files (x86)\Microsoft Visual Studio
10.0\Common7\IDE\;c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\BIN;c:\Program Files (x86)\Microsoft Visual Studio
10.0\Common7\Tools;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Windows\Microsoft.NET\Framework\v3.5;c:\Program
Files (x86)\Microsoft Visual Studio 10.0\VC\VCPackages;C:\Program Files
(x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools;C:\Program Files
(x86)\Microsoft
SDKs\Windows\v7.0A\bin;C:\progs\perl5161-ap1601\site\bin;C:\progs\perl5161-ap1601\bin;C:\Program
Files (x86)\NVIDIA
Corporation\PhysX\Common;c:\bin;C:\Progs\perl5140-ap1400\site\bin;C:\Progs\perl5140-ap1400\bin;C:\Program
Files
(x86)\UltraEdit;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files
(x86)\Common Files\Microsoft Shared\Windows Live;C:\Program
Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth
Software\syswow64;C:\Program Files (x86)\Common Files\Ulead
Systems\MPEG;C:\Program Files\Microsoft Windows Performance
Toolkit\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files
(x86)\QuickTime\QTSystem\
    PERL_BADLANG (unset)
    SHELL (unset)

@p5pRT
Copy link
Author

p5pRT commented Nov 10, 2012

From @bulk88

On Fri Nov 09 11​:49​:44 2012, ikegami@​adaelis.com wrote​:

This is a bug report for perl from ikegami@​adaelis.com,
generated with the help of perlbug 1.39 running under perl 5.16.1.

-----------------------------------------------------------------
[Please describe your issue here]

version->parse (which is to say XS_version_new in universal.c) doesn't
call
mg_get before checking if its argument is defined as it should.

XS_version_new also needs all the ST()s to be converted to C stack SV
*s. Not recalculate from stack_base each time ST(*) is written. Also it
seems to be that bad things will happen if new is called as a func (0
params). Also adding a single SvGETMAGIC to ST(0)/classname and then
nomg accessors afterwards should be done.

@p5pRT
Copy link
Author

p5pRT commented Nov 10, 2012

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jan 24, 2014

From @bulk88

On Fri Nov 09 11​:49​:44 2012, ikegami@​adaelis.com wrote​:

This is a bug report for perl from ikegami@​adaelis.com,
generated with the help of perlbug 1.39 running under perl 5.16.1.

-----------------------------------------------------------------
[Please describe your issue here]

version->parse (which is to say XS_version_new in universal.c) doesn't
call
mg_get before checking if its argument is defined as it should.

$ perl -Mversion -E'
"v1.00" =~ /v(.+)/ or die;
$x=$1 if $ARGV[0];
say version->parse($1);
' 0
0

$ perl -Mversion -e'
"v1.00" =~ /v(.+)/ or die;
$x=$1 if $ARGV[0];
say version->parse($1);
' 1
1.00

Workaroud​:

$ perl -Mversion -E'
"v1.00" =~ /v(.+)/ or die;
say version->parse("$1");
'
1.00


C​:\Documents and Settings\Owner\Desktop\cpan libs\version>perl -Mversion -E"\"v1
.00\" =~ /v(.+)/ or die; $x=$1 if $ARGV[0]; say version->parse($1);" 0
1.00

C​:\Documents and Settings\Owner\Desktop\cpan libs\version>perl -Mversion -E"\"v1
.00\" =~ /v(.+)/ or die; $x=$1 if $ARGV[0]; say version->parse($1);" 1
1.00

C​:\Documents and Settings\Owner\Desktop\cpan libs\version>


This was fixed in http​://perl5.git.perl.org/perl.git/commit/0c1d6ad7c56336f44f5ca9213891dc048565bb49?f=universal.c in blead, which came from https​://bitbucket.org/jpeacock/version/commits/6fd396e1006b2190317035f3272128f9ed34098a which claimed to fix https://rt.cpan.org/Public/Bug/Display.html?id=87983

There are still outstanding issues that I raised in https://rt-archive.perl.org/perl5/Ticket/Display.html?id=115660#txn-1169402 so this can't be closed yet. I'll try to get to them today and submit upstream.

--
bulk88 ~ bulk88 at hotmail.com

@p5pRT
Copy link
Author

p5pRT commented Jan 24, 2014

From @bulk88

On Fri Jan 24 04​:27​:05 2014, bulk88 wrote​:

There are still outstanding issues that I raised in
https://rt-archive.perl.org/perl5/Ticket/Display.html?id=115660#txn-1169402 so this
can't be closed yet. I'll try to get to them today and submit
upstream.

now depending on https://rt.cpan.org/Ticket/Display.html?id=92438

--
bulk88 ~ bulk88 at hotmail.com

@p5pRT
Copy link
Author

p5pRT commented Mar 5, 2014

From @bulk88

On Fri Jan 24 15​:40​:53 2014, bulk88 wrote​:

On Fri Jan 24 04​:27​:05 2014, bulk88 wrote​:

There are still outstanding issues that I raised in
https://rt-archive.perl.org/perl5/Ticket/Display.html?id=115660#txn-1169402 so this
can't be closed yet. I'll try to get to them today and submit
upstream.

now depending on https://rt.cpan.org/Ticket/Display.html?id=92438

That bug is resolved. Someone needs to resolve this now.

--
bulk88 ~ bulk88 at hotmail.com

@p5pRT
Copy link
Author

p5pRT commented Mar 5, 2014

From @khwilliamson

Resolved, as per request
--
Karl Williamson

@p5pRT
Copy link
Author

p5pRT commented Mar 5, 2014

@khwilliamson - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant