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

Owner: Nobody
Requestors: TODDR <toddr [at]>

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


Date: Fri, 10 Nov 2017 23:34:26 -0600
Subject: B::Deparse generated code affected by use vars?
To: perlbug [...]
From: Todd Rinaldo <toddr [...]>
Download (untitled) / with headers
text/plain 3.2k
This is a bug report for perl from, generated with the help of perlbug 1.41 running under perl 5.27.6. ----------------------------------------------------------------- [Please describe your issue here] I discovered that the removal of 'use vars' from B::Deparse affects the WARNINGS_BITS of deparsed code. I think the attached patch actually makes for a more pristine deparse. [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=library severity=low module=B::Deparse --- Site configuration information for perl 5.27.6: Configured by root at Fri Nov 10 21:43:02 CST 2017. Summary of my perl5 (revision 5 version 27 subversion 6) configuration: Commit id: 8d6363863eb2ae5eb05a83c01c276a321727c828 Platform: osname=linux osvers=3.10.0-693.2.2.el7.x86_64 archname=x86_64-linux-thread-multi uname='linux 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='-des -Dusedevel -Uversiononly -Dcc=gcc -Dusethreads -Dprefix= -DDEBUGGING' hint=recommended useposix=true d_sigaction=define useithreads=define usemultiplicity=define use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n default_inc_excludes_dot=define bincompat5005=undef Compiler: cc='gcc' ccflags ='-D_REENTRANT -D_GNU_SOURCE -fwrapv -DDEBUGGING -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 -g' cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -DDEBUGGING -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='gcc' 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 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 -g -L/usr/local/lib -fstack-protector-strong' --- @INC for perl 5.27.6: /root/projects/perl/lib /usr/local/lib/perl5/site_perl/5.27.6/x86_64-linux-thread-multi /usr/local/lib/perl5/site_perl/5.27.6 /usr/local/lib/perl5/5.27.6/x86_64-linux-thread-multi /usr/local/lib/perl5/5.27.6 --- Environment for perl 5.27.6: HOME=/root LANG=en_US.UTF-8 LANGUAGE (unset) LD_LIBRARY_PATH=/root/projects/perl LOGDIR (unset) PATH=/bin PERL_BADLANG (unset) SHELL=/bin/zsh
RT-Send-CC: perl5-porters [...]
Subject: 0001-Remove-use-vars-from-B-Deparse.patch
From 7a0d115e87d52694a2eb0b5de6406b55f91762b9 Mon Sep 17 00:00:00 2001 From: Todd Rinaldo <> Date: Fri, 10 Nov 2017 23:01:27 -0600 Subject: [PATCH] Remove use vars from B::Deparse --- lib/B/ | 2 +- lib/B/Deparse.t | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/B/ b/lib/B/ index 7609d638ee..71fd4a7d3a 100644 --- a/lib/B/ +++ b/lib/B/ @@ -53,7 +53,7 @@ use B qw(class main_root main_start main_cv svref_2object opnumber perlstring $VERSION = '1.45'; use strict; -use vars qw/$AUTOLOAD/; +our $AUTOLOAD; use warnings (); require feature; diff --git a/lib/B/Deparse.t b/lib/B/Deparse.t index d94d7f61da..833f0a7853 100644 --- a/lib/B/Deparse.t +++ b/lib/B/Deparse.t @@ -1996,7 +1996,7 @@ no warnings "experimental::lexical_subs"; my sub f {} print f(); >>>> -BEGIN {${^WARNING_BITS} = "\x54\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x54\x55\x55\x55"} +BEGIN {${^WARNING_BITS} = "\x54\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x54\x55\x55\x15"} my sub f { } @@ -2009,7 +2009,7 @@ no warnings 'experimental::lexical_subs'; state sub f {} print f(); >>>> -BEGIN {${^WARNING_BITS} = "\x54\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x54\x55\x55\x55"} +BEGIN {${^WARNING_BITS} = "\x54\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x54\x55\x55\x15"} state sub f { } -- 2.15.0
RT-Send-CC: perl5-porters [...]
Download (untitled) / with headers
text/plain 760b
Show quoted text
> ----------------------------------------------------------------- > [Please describe your issue here] > > I discovered that the removal of 'use vars' from B::Deparse affects > the WARNINGS_BITS of deparsed code. I think the attached patch > actually makes for a more pristine deparse. >
It looks like this bit is coming from warnings::register as called from use vars, which means it's desirable to remove use vars from B::Deparse. BEFORE: $>perl -E'use warnings::register; use warnings; BEGIN { printf("%x", $_) foreach unpack("C*", ${^WARNING_BITS}) } print "\n\n"' 5555555555555555555555555555555555 AFTER: $>perl -E'use warnings; BEGIN { printf("%x", $_) foreach unpack("C*", ${^WARNING_BITS}) } print "\n\n"' 5555555555555555555555555555555515
RT-Send-CC: perl5-porters [...]
Merged to blead in commit 1218f5ba79acb362f5b62f3f11ce1822d6599bf5

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

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