Skip Menu |
Report information
Id: 132160
Status: pending release
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: atoomic [at] cpan.org
Cc:
AdminCc:

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



To: perlbug [...] perl.org
From: "Nicolas R." <atoomic [...] cpan.org>
Subject: Use SvLEN_set/SvCUR_set in a few extra locations
Date: Mon, 25 Sep 2017 12:48:01 -0600
Download (untitled) / with headers
text/plain 3.4k
This is a bug report for perl from atoomic@cpan.org,
generated with the help of perlbug 1.40 running under perl 5.27.5.


-----------------------------------------------------------------
SvLEN was set without using the generic macro SvLEN_set.
Use it in three extra locations, and also use SvCUR_set
instead of SvCUR.

run test on linux using: TEST_JOBS=10 make -j10 test_harness
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
Site configuration information for perl 5.27.5:

Configured by root at Mon Sep 25 13:38:40 CDT 2017.

Summary of my perl5 (revision 5 version 27 subversion 5) configuration:
  Commit id: 8dbf3fcb11c15d2503dd8f6a902429bbd53e0acf
  Platform:
    osname=linux
    osvers=3.10.0-693.2.2.el7.x86_64
    archname=x86_64-linux
    uname='linux nico-c7.dev.cpanel.net 3.10.0-693.2.2.el7.x86_64 #1 smp tue sep 12 22:26:13 utc 2017 x86_64 x86_64 x86_64 gnulinux '
    config_args='-Dusedevel -des'
    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.8.5 20150623 (Red Hat 4.8.5-16)'
    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 /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64
    libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.17.so
    so=so
    useshrplib=false
    libperl=libperl.a
    gnulibc_version='2.17'
  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'


---
@INC for perl 5.27.5:
    lib
    /root/.dotfiles/perl-must-have/lib
    /root/perl5/lib/perl5/
    /usr/local/lib/perl5/site_perl/5.27.5/x86_64-linux
    /usr/local/lib/perl5/site_perl/5.27.5
    /usr/local/lib/perl5/5.27.5/x86_64-linux
    /usr/local/lib/perl5/5.27.5

---
Environment for perl 5.27.5:
    HOME=/root
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/local/cpanel/3rdparty/perl/526/bin:/usr/local/cpanel/3rdparty/perl/524/bin:/usr/local/cpanel/3rdparty/perl/522/bin:/usr/local/cpanel/3rdparty/perl/514/bin:/usr/local/cpanel/3rdparty/bin:/root/bin/:/opt/local/bin:/opt/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/cpanel/composer/bin:/root/.dotfiles/bin:/root/perl5/bin:/root/.rvm/bin:/root/bin
    PERL5DB=use Devel::NYTProf
    PERL5LIB=/root/.dotfiles/perl-must-have/lib::/root/perl5/lib/perl5/
    PERL_BADLANG (unset)
    PERL_CPANM_OPT=--quiet
    SHELL=/bin/bash

Message body is not shown because sender requested not to inline it.

RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 3.7k
inline patch On Mon, 25 Sep 2017 11:48:15 -0700, atoomic@cpan.org wrote: Show quoted text
> This is a bug report for perl from atoomic@cpan.org, > generated with the help of perlbug 1.40 running under perl 5.27.5. > > > ----------------------------------------------------------------- > SvLEN was set without using the generic macro SvLEN_set. > Use it in three extra locations, and also use SvCUR_set > instead of SvCUR. > > run test on linux using: TEST_JOBS=10 make -j10 test_harness > ----------------------------------------------------------------- > --- > Flags: > category=core > severity=low > --- > Site configuration information for perl 5.27.5: > > Configured by root at Mon Sep 25 13:38:40 CDT 2017. > > Summary of my perl5 (revision 5 version 27 subversion 5) > configuration: > Commit id: 8dbf3fcb11c15d2503dd8f6a902429bbd53e0acf > Platform: > osname=linux > osvers=3.10.0-693.2.2.el7.x86_64 > archname=x86_64-linux > uname='linux nico-c7.dev.cpanel.net 3.10.0-693.2.2.el7.x86_64 #1 > smp > tue sep 12 22:26:13 utc 2017 x86_64 x86_64 x86_64 gnulinux ' > config_args='-Dusedevel -des' > 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.8.5 20150623 (Red Hat 4.8.5-16)' > 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 /lib/../lib64 /usr/lib/../lib64 > /lib > /lib64 /usr/lib64 /usr/local/lib64 > libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc > -lgdbm_compat > perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc > libc=libc-2.17.so > so=so > useshrplib=false > libperl=libperl.a > gnulibc_version='2.17' > 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' > > > --- > @INC for perl 5.27.5: > lib > /root/.dotfiles/perl-must-have/lib > /root/perl5/lib/perl5/ > /usr/local/lib/perl5/site_perl/5.27.5/x86_64-linux > /usr/local/lib/perl5/site_perl/5.27.5 > /usr/local/lib/perl5/5.27.5/x86_64-linux > /usr/local/lib/perl5/5.27.5 > > --- > Environment for perl 5.27.5: > HOME=/root > LANG=en_US.UTF-8 > LANGUAGE (unset) > LD_LIBRARY_PATH (unset) > LOGDIR (unset) > > PATH=/usr/local/cpanel/3rdparty/perl/526/bin:/usr/local/cpanel/3rdparty/perl/524/bin:/usr/local/cpanel/3rdparty/perl/522/bin:/usr/local/cpanel/3rdparty/perl/514/bin:/usr/local/cpanel/3rdparty/bin:/root/bin/:/opt/local/bin:/opt/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/cpanel/composer/bin:/root/.dotfiles/bin:/root/perl5/bin:/root/.rvm/bin:/root/bin > PERL5DB=use Devel::NYTProf > PERL5LIB=/root/.dotfiles/perl-must- > have/lib::/root/perl5/lib/perl5/ > PERL_BADLANG (unset) > PERL_CPANM_OPT=--quiet > SHELL=/bin/bash
Subject: 0001-Use-SvLEN_set-SvCUR_set-in-a-few-extra-locations.patch
From 8dbf3fcb11c15d2503dd8f6a902429bbd53e0acf Mon Sep 17 00:00:00 2001 From: Nicolas R <atoomic@cpan.org> Date: Mon, 25 Sep 2017 13:37:06 -0500 Subject: [PATCH] Use SvLEN_set/SvCUR_set in a few extra locations SvLEN was set without using the generic macro SvLEN_set. Use it in three extra locations, and also use SvCUR_set instead of SvCUR. --- gv.c | 2 +- toke.c | 4 ++-- universal.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gv.c b/gv.c index 6df78cc013..5a1bbd8608 100644 --- a/gv.c +++ b/gv.c @@ -1262,7 +1262,7 @@ Perl_gv_autoload_pvn(pTHX_ HV *stash, const char *name, STRLEN len, U32 flags) sv_setsv_nomg((SV *)cv, tmpsv); SvTEMP_off(tmpsv); SvREFCNT_dec_NN(tmpsv); - SvLEN(cv) = SvCUR(cv) + 1; + SvLEN_set(cv, SvCUR(cv) + 1); SvCUR(cv) = ulen; } else { diff --git a/toke.c b/toke.c index a91a4fcfbe..74e0027f7d 100644 --- a/toke.c +++ b/toke.c @@ -4443,8 +4443,8 @@ Perl_filter_add(pTHX_ filter_t funcp, SV *datasv) PL_parser->last_uni = buf + last_uni_pos; if (PL_parser->last_lop) PL_parser->last_lop = buf + last_lop_pos; - SvLEN(linestr) = SvCUR(linestr); - SvCUR(linestr) = s-SvPVX(linestr); + SvLEN_set(linestr, SvCUR(linestr)); + SvCUR_set(linestr, s - SvPVX(linestr)); PL_parser->filtered = 1; break; } diff --git a/universal.c b/universal.c index 65477fb775..2262939b8d 100644 --- a/universal.c +++ b/universal.c @@ -225,8 +225,8 @@ Perl_sv_does_sv(pTHX_ SV *sv, SV *namesv, U32 flags) /* create a PV with value "isa", but with a special address * so that perl knows we're really doing "DOES" instead */ methodname = newSV_type(SVt_PV); - SvLEN(methodname) = 0; - SvCUR(methodname) = strlen(PL_isa_DOES); + SvLEN_set(methodname, 0); + SvCUR_set(methodname, strlen(PL_isa_DOES)); SvPVX(methodname) = (char *)PL_isa_DOES; /* discard 'const' qualifier */ SvPOK_on(methodname); sv_2mortal(methodname); -- 2.14.1
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 330b
On Mon, 25 Sep 2017 11:48:15 -0700, atoomic@cpan.org wrote: Show quoted text
> SvLEN was set without using the generic macro SvLEN_set. > Use it in three extra locations, and also use SvCUR_set > instead of SvCUR. > > run test on linux using: TEST_JOBS=10 make -j10 test_harness
Thanks, applied as 59c3c222a42121edb1b3cdd9c71d3c878e3ddb18. Tony


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