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

[PATCH] Typo prevents deparsing some transliterations. #16226

Closed
p5pRT opened this issue Nov 6, 2017 · 7 comments
Closed

[PATCH] Typo prevents deparsing some transliterations. #16226

p5pRT opened this issue Nov 6, 2017 · 7 comments

Comments

@p5pRT
Copy link

p5pRT commented Nov 6, 2017

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

Searchable as RT132405$

@p5pRT
Copy link
Author

p5pRT commented Nov 6, 2017

From @lightsey

This is a bug report for perl from john@​nixnuts.net,
generated with the help of perlbug 1.40 running under perl 5.27.6.


There is a simple typo in B​::Deparse that prevents deparsing code
that contains transliterations of characters with ordinals below 27.

Patch with unit test attached.



Flags​:
  category=library
  severity=low
  Type=Patch
  PatchStatus=HasPatch
  module=B​::Deparse


Site configuration information for perl 5.27.6​:

Configured by jd at Tue Oct 31 18​:13​:33 CDT 2017.

Summary of my perl5 (revision 5 version 27 subversion 6) configuration​:
  Local Commit​: 90fcbde852f41db175162eedc4b5b3f9845901ed
  Ancestor​: 125cf57
  Platform​:
  osname=linux
  osvers=4.9.0-4-amd64
  archname=x86_64-linux
  uname='linux toucan 4.9.0-4-amd64 #1 smp debian 4.9.51-1 (2017-09-28) x86_64 gnulinux '
  config_args='-Dusedevel -d'
  hint=previous
  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='6.3.0 20170516'
  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/6/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 /usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/6/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/6/include-fixed /usr/include/x86_64-linux-gnu /usr/lib
  libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
  perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
  libc=libc-2.24.so
  so=so
  useshrplib=false
  libperl=libperl.a
  gnulibc_version='2.24'
  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​:
  90fcbde852f41db175162eedc4b5b3f9845901ed


@​INC for perl 5.27.6​:
  lib
  /usr/local/lib/perl5/site_perl/5.27.6/x86_64-linux
  /usr/local/lib/perl5/site_perl/5.27.6
  /usr/local/lib/perl5/5.27.6/x86_64-linux
  /usr/local/lib/perl5/5.27.6


Environment for perl 5.27.6​:
  HOME=/home/jd
  LANG=en_US.UTF-8
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/home/jd/bin​:/home/jd/bin​:/usr/local/bin​:/usr/bin​:/bin​:/usr/local/games​:/usr/games
  PERL_BADLANG (unset)
  SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Nov 6, 2017

From @lightsey

0001-Fix-deparsing-of-transliterations-with-unprintable-c.patch
From 90fcbde852f41db175162eedc4b5b3f9845901ed Mon Sep 17 00:00:00 2001
From: John Lightsey <lightsey@debian.org>
Date: Tue, 31 Oct 2017 18:12:26 -0500
Subject: [PATCH] Fix deparsing of transliterations with unprintable
 characters.

---
 lib/B/Deparse.pm | 2 +-
 lib/B/Deparse.t  | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/B/Deparse.pm b/lib/B/Deparse.pm
index 4ff427c51c..ceefa58009 100644
--- a/lib/B/Deparse.pm
+++ b/lib/B/Deparse.pm
@@ -5632,7 +5632,7 @@ sub pchr { # ASCII
     } elsif ($n == ord "\r") {
 	return '\\r';
     } elsif ($n >= ord("\cA") and $n <= ord("\cZ")) {
-	return '\\c' . unctrl{chr $n};
+	return '\\c' . $unctrl{chr $n};
     } else {
 #	return '\x' . sprintf("%02x", $n);
 	return '\\' . sprintf("%03o", $n);
diff --git a/lib/B/Deparse.t b/lib/B/Deparse.t
index b75a162a0e..d94d7f61da 100644
--- a/lib/B/Deparse.t
+++ b/lib/B/Deparse.t
@@ -2851,3 +2851,8 @@ $x = `$a-$b`;
 # multiconcat within qr//
 my($r, $a, $b);
 $r = qr/abc\Q$a-$b\Exyz/;
+####
+# tr with unprintable characters
+my $str;
+$str = 'foo';
+$str =~ tr/\cA//;
-- 
2.11.0

@p5pRT
Copy link
Author

p5pRT commented Nov 6, 2017

From @atoomic

Thanks going to run a smoke before merging it

On Mon, 06 Nov 2017 08​:22​:07 -0800, john@​nixnuts.net wrote​:

This is a bug report for perl from john@​nixnuts.net,
generated with the help of perlbug 1.40 running under perl 5.27.6.

-----------------------------------------------------------------
There is a simple typo in B​::Deparse that prevents deparsing code
that contains transliterations of characters with ordinals below 27.

Patch with unit test attached.
-----------------------------------------------------------------
---
Flags​:
category=library
severity=low
Type=Patch
PatchStatus=HasPatch
module=B​::Deparse
---
Site configuration information for perl 5.27.6​:

Configured by jd at Tue Oct 31 18​:13​:33 CDT 2017.

Summary of my perl5 (revision 5 version 27 subversion 6)
configuration​:
Local Commit​: 90fcbde852f41db175162eedc4b5b3f9845901ed
Ancestor​: 125cf57
Platform​:
osname=linux
osvers=4.9.0-4-amd64
archname=x86_64-linux
uname='linux toucan 4.9.0-4-amd64 #1 smp debian 4.9.51-1 (2017-09-
28) x86_64 gnulinux '
config_args='-Dusedevel -d'
hint=previous
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='6.3.0 20170516'
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/6/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
/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/6/include-fixed
/usr/include/x86_64-linux-gnu /usr/lib /usr/local/lib
/usr/lib/gcc/x86_64-linux-gnu/6/include-fixed /usr/include/x86_64-
linux-gnu /usr/lib
libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
-lgdbm_compat
perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
libc=libc-2.24.so
so=so
useshrplib=false
libperl=libperl.a
gnulibc_version='2.24'
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​:
90fcbde852f41db175162eedc4b5b3f9845901ed

---
@​INC for perl 5.27.6​:
lib
/usr/local/lib/perl5/site_perl/5.27.6/x86_64-linux
/usr/local/lib/perl5/site_perl/5.27.6
/usr/local/lib/perl5/5.27.6/x86_64-linux
/usr/local/lib/perl5/5.27.6

---
Environment for perl 5.27.6​:
HOME=/home/jd
LANG=en_US.UTF-8
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/home/jd/bin​:/home/jd/bin​:/usr/local/bin​:/usr/bin​:/bin​:/usr/local/games​:/usr/games
PERL_BADLANG (unset)
SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Nov 6, 2017

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

@p5pRT
Copy link
Author

p5pRT commented Nov 6, 2017

From @atoomic

merged with b4fb15a

On Mon, 06 Nov 2017 08​:25​:42 -0800, atoomic wrote​:

Thanks going to run a smoke before merging it

On Mon, 06 Nov 2017 08​:22​:07 -0800, john@​nixnuts.net wrote​:

This is a bug report for perl from john@​nixnuts.net,
generated with the help of perlbug 1.40 running under perl 5.27.6.

-----------------------------------------------------------------
There is a simple typo in B​::Deparse that prevents deparsing code
that contains transliterations of characters with ordinals below 27.

Patch with unit test attached.
-----------------------------------------------------------------
---
Flags​:
category=library
severity=low
Type=Patch
PatchStatus=HasPatch
module=B​::Deparse
---
Site configuration information for perl 5.27.6​:

Configured by jd at Tue Oct 31 18​:13​:33 CDT 2017.

Summary of my perl5 (revision 5 version 27 subversion 6)
configuration​:
Local Commit​: 90fcbde852f41db175162eedc4b5b3f9845901ed
Ancestor​: 125cf57
Platform​:
osname=linux
osvers=4.9.0-4-amd64
archname=x86_64-linux
uname='linux toucan 4.9.0-4-amd64 #1 smp debian 4.9.51-1 (2017-
09-
28) x86_64 gnulinux '
config_args='-Dusedevel -d'
hint=previous
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='6.3.0 20170516'
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/6/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
/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/6/include-fixed
/usr/include/x86_64-linux-gnu /usr/lib /usr/local/lib
/usr/lib/gcc/x86_64-linux-gnu/6/include-fixed /usr/include/x86_64-
linux-gnu /usr/lib
libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
-lgdbm_compat
perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
libc=libc-2.24.so
so=so
useshrplib=false
libperl=libperl.a
gnulibc_version='2.24'
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​:
90fcbde852f41db175162eedc4b5b3f9845901ed

---
@​INC for perl 5.27.6​:
lib
/usr/local/lib/perl5/site_perl/5.27.6/x86_64-linux
/usr/local/lib/perl5/site_perl/5.27.6
/usr/local/lib/perl5/5.27.6/x86_64-linux
/usr/local/lib/perl5/5.27.6

---
Environment for perl 5.27.6​:
HOME=/home/jd
LANG=en_US.UTF-8
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/home/jd/bin​:/home/jd/bin​:/usr/local/bin​:/usr/bin​:/bin​:/usr/local/games​:/usr/games
PERL_BADLANG (unset)
SHELL=/bin/bash

@p5pRT p5pRT closed this as completed Nov 6, 2017
@p5pRT
Copy link
Author

p5pRT commented Nov 6, 2017

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

@p5pRT
Copy link
Author

p5pRT commented Nov 7, 2017

From @xsawyerx

On 11/06/2017 05​:25 PM, Atoomic via RT wrote​:

Thanks going to run a smoke before merging it

+1

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

No branches or pull requests

1 participant