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

Bleadperl v5.21.6-89-gd648ffc breaks autobox #14423

Closed
p5pRT opened this issue Jan 18, 2015 · 18 comments
Closed

Bleadperl v5.21.6-89-gd648ffc breaks autobox #14423

p5pRT opened this issue Jan 18, 2015 · 18 comments

Comments

@p5pRT
Copy link

p5pRT commented Jan 18, 2015

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

Searchable as RT123619$

@p5pRT
Copy link
Author

p5pRT commented Jan 18, 2015

From @cpansprout

commit d648ffc
Author​: syber <syber@​crazypanda.ru>
Date​: Mon Nov 24 18​:55​:15 2014 +0300

  Remove op_const_class; just use the name on the stack

See <https://rt.cpan.org/Ticket/Display.html?id=100819>.

I suspect we have a blead regression that affects pure-Perl code, and not just autobox, and that the simplest fix will fix autobox as well.

This definitely needs to be looked into before 5.22.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2015

From @iabyn

On Sat, Jan 17, 2015 at 10​:41​:04PM -0800, Father Chrysostomos wrote​:

commit d648ffc
Author​: syber <syber@​crazypanda.ru>
Date​: Mon Nov 24 18​:55​:15 2014 +0300

Remove op\_const\_class; just use the name on the stack

See <https://rt.cpan.org/Ticket/Display.html?id=100819>.

I suspect we have a blead regression that affects pure-Perl code, and
not just autobox, and that the simplest fix will fix autobox as well.

Autobox has XS code that changes PL_check[OP_ENTERSUB] to a function
that goes rummaging around in the in the optree (including looking for
OP_METHOD nodes).

I would expect in the first instance that it is autobox which needs
fixing.

--
You never really learn to swear until you learn to drive.

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2015

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

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2015

From @Leont

On Sun, Jan 18, 2015 at 7​:41 AM, Father Chrysostomos <
perlbug-followup@​perl.org> wrote​:

# New Ticket Created by Father Chrysostomos
# Please include the string​: [perl #123619]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=123619 >

commit d648ffc
Author​: syber <syber@​crazypanda.ru>
Date​: Mon Nov 24 18​:55​:15 2014 +0300

Remove op\_const\_class; just use the name on the stack

See <https://rt.cpan.org/Ticket/Display.html?id=100819>.

I suspect we have a blead regression that affects pure-Perl code, and not
just autobox, and that the simplest fix will fix autobox as well.

This definitely needs to be looked into before 5.22.

Suggested fix attached.

Leon

@p5pRT
Copy link
Author

p5pRT commented Jan 21, 2015

From @Leont

0001-perl-123619-Only-make-stringy-classnames-shared.patch
From 119e4602d2867d8ca7d154fd7f6820a18b78ed45 Mon Sep 17 00:00:00 2001
From: Leon Timmermans <fawaka@gmail.com>
Date: Wed, 21 Jan 2015 23:43:36 +0100
Subject: [PATCH] [perl #123619] Only make stringy classnames shared

This caused failures in autobox that expect their invocant to be something
other than a string (e.g. a number). See also [cpan #123619].
---
 op.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/op.c b/op.c
index d2ce7b9..e01e58b 100644
--- a/op.c
+++ b/op.c
@@ -11894,7 +11894,7 @@ Perl_ck_subr(pTHX_ OP *o)
 	    }
 	    /* make class name a shared cow string to speedup method calls */
 	    /* constant string might be replaced with object, f.e. bigint */
-	    if (const_class && !SvROK(*const_class)) {
+	    if (const_class && SvPOK(*const_class)) {
 		STRLEN len;
 		const char* str = SvPV(*const_class, len);
 		if (len) {
-- 
2.2.0-369-g3b010e3

@p5pRT
Copy link
Author

p5pRT commented Jan 22, 2015

From @cpansprout

On Wed Jan 21 04​:53​:22 2015, davem wrote​:

On Sat, Jan 17, 2015 at 10​:41​:04PM -0800, Father Chrysostomos wrote​:

commit d648ffc
Author​: syber <syber@​crazypanda.ru>
Date​: Mon Nov 24 18​:55​:15 2014 +0300

Remove op\_const\_class; just use the name on the stack

See <https://rt.cpan.org/Ticket/Display.html?id=100819>.

I suspect we have a blead regression that affects pure-Perl code, and
not just autobox, and that the simplest fix will fix autobox as well.

Autobox has XS code that changes PL_check[OP_ENTERSUB] to a function
that goes rummaging around in the in the optree (including looking for
OP_METHOD nodes).

I would expect in the first instance that it is autobox which needs
fixing.

It’s not just autobox that is affected​:

$ perl5.20.1 -e 'use constant H => do { my $fh = do { local *F }; *$fh = *STDOUT{IO} }; H->autoflush(1)'
$ ./perl -Ilib -e 'use constant H => do { my $fh = do { local *F }; *$fh = *STDOUT{IO} }; H->autoflush(1)'
Can't locate object method "autoflush" via package "*main​::F" (perhaps you forgot to load "*main​::F"?) at -e line 1.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Jan 22, 2015

From @cpansprout

On Wed Jan 21 14​:53​:55 2015, LeonT wrote​:

On Sun, Jan 18, 2015 at 7​:41 AM, Father Chrysostomos <
perlbug-followup@​perl.org> wrote​:

# New Ticket Created by Father Chrysostomos
# Please include the string​: [perl #123619]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=123619 >

commit d648ffc
Author​: syber <syber@​crazypanda.ru>
Date​: Mon Nov 24 18​:55​:15 2014 +0300

Remove op\_const\_class; just use the name on the stack

See <https://rt.cpan.org/Ticket/Display.html?id=100819>.

I suspect we have a blead regression that affects pure-Perl code, and not
just autobox, and that the simplest fix will fix autobox as well.

This definitely needs to be looked into before 5.22.

Suggested fix attached.

I think that would work, but I need to translate the 2-line one-liner from the previous message into a test, or someone needs to beat me to it.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Jan 22, 2015

From @kentfredric

op/gv.t seemed like the right place for it.

@p5pRT
Copy link
Author

p5pRT commented Jan 22, 2015

From @kentfredric

0002-Add-test-for-glob-constants-accepting-method-calls.patch
From 63f243c0d6085b2bb57f3fbef97a86e2613bd321 Mon Sep 17 00:00:00 2001
From: Kent Fredric <kentfredric@gmail.com>
Date: Thu, 22 Jan 2015 23:15:51 +1300
Subject: [PATCH] Add test for glob constants accepting method calls

This specific case tripped up autobox.pm.
---
 t/op/gv.t | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/t/op/gv.t b/t/op/gv.t
index 081d280..97d0f3f 100644
--- a/t/op/gv.t
+++ b/t/op/gv.t
@@ -12,7 +12,7 @@ BEGIN {
 
 use warnings;
 
-plan( tests => 271 );
+plan( tests => 273 );
 
 # type coercion on assignment
 $foo = 'foo';
@@ -1073,6 +1073,14 @@ package glob_constant_test {
   ::is eval { bar->() }, eval { &{+bar} },
     'glob_constant->() is not mangled at compile time';
   ::is "$@", "", 'no error from eval { &{+glob_constant} }';
+  use constant quux => do {
+    local *F;
+    my $f = *F;
+    *$f = *STDOUT{IO};
+  };
+  ::is eval { quux->autoflush; 420 }, 420,
+    'glob_constant->method() works';
+  ::is "$@", "", 'no error from eval { glob_constant->method() }';
 }
 
 {
-- 
2.2.1

@p5pRT
Copy link
Author

p5pRT commented Jan 22, 2015

From @kentfredric

Having applied these patches, autobox now installs, however, a subsequent error appears in Moose​::Autobox with string handling.

Namely,

  ("Hello\n")->chomp

Is expected to die due to readonly modification. However, it doesn't.

This​:

  for my $x (q(Hello\n)) {
  $x->chomp
  }

Does still die however.

@p5pRT
Copy link
Author

p5pRT commented Jan 22, 2015

From @kentfredric

#!/usr/bin/env perl

use strict;
use warnings;

use Moose​::Autobox;
use Test​::More tests => 2;
use Runops​::Trace qw( set_tracer enable_tracing disable_tracing );
use B​::Concise;
set_tracer(sub {
  my @​context = caller(0);
  printf "%s,%s,%s​: ", @​context[0..2];
  B​::Concise​::b_terse($_[0],0);
});

{
  my ( $return ) = do {
  local $@​;
  my $x = {
  rval => scalar eval { for my $x ("Hello\n") {
  enable_tracing();
  $x->chomp
  }; 1 },
  ex => $@​
  };
  disable_tracing;
  $x;
  };

  ok( !$return->{rval}, "Constant from a loop is readonly" );
  note explain $return;
}
{
  my ( $return ) = do {
  local $@​;
  my $x = {
  rval => scalar eval {
  enable_tracing();
  "Hello\n"->chomp ; 1
  },
  ex => $@​
  };
  disable_tracing();
  $x;
  };

  ok( !$return->{rval}, "In place constant is readonly" );
  note explain $return;
}

__END__

__OPTRACE_OUTPUT__
perl -Ilib /tmp/test.pl
1..2
main,/tmp/test.pl,49​: COP (0x32ef2b0) nextstate
main,/tmp/test.pl,50​: OP (0x32ef3a0) pushmark
main,/tmp/test.pl,50​: OP (0x32ef3e0) padsv [5]
method_named is a 0
main,/tmp/test.pl,50​: METHOP (0x32ef358) method_named PV (0x315a1a8) "chomp"
main,/tmp/test.pl,50​: UNOP (0x32ef310) entersub [8]
main,/tmp/test.pl,50​: COP (0x2c2c3a8) nextstate
Moose​::Autobox​::String,lib/Moose/Autobox/String.pm,14​: SVOP (0x2c2bfb8) aelemfast GV (0x1c190a0) *_
Moose​::Autobox​::String,lib/Moose/Autobox/String.pm,14​: UNOP (0x2c2be20) schomp [1]
main,/tmp/test.pl,48​: SVOP (0x32eedf0) const PV (0x310c290) "ex"
main,/tmp/test.pl,48​: SVOP (0x32eeda0) gvsv GV (0x1c190d0) *@​
main,/tmp/test.pl,48​: LISTOP (0x32eee68) anonhash
main,/tmp/test.pl,48​: OP (0x32e68a8) padsv [4]
main,/tmp/test.pl,48​: BINOP (0x3290a40) sassign
main,/tmp/test.pl,48​: COP (0x3290840) nextstate
main,/tmp/test.pl,54​: OP (0x32908e0) pushmark
main,/tmp/test.pl,54​: SVOP (0x3290958) gv GV (0x3112ea8) *disable_tracing
main,/tmp/test.pl,54​: UNOP (0x32908a0) entersub [9]
ok 1 - Constant from a loop is readonly
# {
# 'ex' => 'Modification of a read-only value attempted at lib/Moose/Autobox/String.pm line 14.
# ',
# 'rval' => undef
# }
main,/tmp/test.pl,66​: COP (0x31bf9a8) nextstate
main,/tmp/test.pl,67​: OP (0x31bfb18) pushmark
main,/tmp/test.pl,67​: SVOP (0x31bfad0) const PV (0x316aa78) "Hello\n"
method_named is a 0
main,/tmp/test.pl,67​: METHOP (0x31bfa50) method_named PV (0x316aaa8) "chomp"
main,/tmp/test.pl,67​: UNOP (0x31bfa08) entersub [15]
main,/tmp/test.pl,67​: COP (0x2c2c3a8) nextstate
Moose​::Autobox​::String,lib/Moose/Autobox/String.pm,14​: SVOP (0x2c2bfb8) aelemfast GV (0x1c190a0) *_
Moose​::Autobox​::String,lib/Moose/Autobox/String.pm,14​: UNOP (0x2c2be20) schomp [1]
Moose​::Autobox​::String,lib/Moose/Autobox/String.pm,14​: UNOP (0x2c2c320) leavesub [1]
main,/tmp/test.pl,67​: COP (0x31bf900) nextstate
main,/tmp/test.pl,67​: SVOP (0x31bf960) const IV (0x316ab50) 1
main,/tmp/test.pl,67​: LISTOP (0x31bfb58) leavetry
main,/tmp/test.pl,65​: SVOP (0x31bf7f0) const PV (0x3112e78) "ex"
main,/tmp/test.pl,65​: SVOP (0x31bf7b0) gvsv GV (0x1c190d0) *@​
main,/tmp/test.pl,65​: LISTOP (0x31bf830) anonhash
main,/tmp/test.pl,65​: OP (0x328fc20) padsv [12]
main,/tmp/test.pl,65​: BINOP (0x31bf728) sassign
main,/tmp/test.pl,65​: COP (0x31bf518) nextstate
main,/tmp/test.pl,71​: OP (0x31bf640) pushmark
main,/tmp/test.pl,71​: SVOP (0x31bf680) gv GV (0x3112ea8) *disable_tracing
main,/tmp/test.pl,71​: UNOP (0x31bf578) entersub [16]
not ok 2 - In place constant is readonly
# Failed test 'In place constant is readonly'
# at /tmp/test.pl line 75.
# {
# 'ex' => '',
# 'rval' => 1
# }
# Looks like you failed 1 test of 2.

__CONCISE_OUTPUT__
perl -MO=Concise -Ilib /tmp/test.pl
2m <@​> leave[1 ref] vKP/REFC ->(end)
1 <0> enter ->2
2 <;> nextstate(main 19096 test.pl​:14) v​:%,*,&,{,x*,x&,x$,$,2147483648 ->3
7 <1> entersub[t2] vKS/TARG,STRICT ->8
- <1> ex-list K ->7
3 <0> pushmark s ->4
5 <1> srefgen sKM/1 ->6
- <1> ex-list lKRM ->5
4 <$> anoncode[CV ] sRM ->5
- <1> ex-rv2cv sK/STRICT,1 ->-
6 <$> gv(*set_tracer) s ->7
8 <;> nextstate(main 19100 test.pl​:34) v​:%,*,&,{,x*,x&,x$,$,2147483648 ->9
1e <2> leaveloop vK/2 ->1f
9 <{> enterloop(next->1e last->1e redo->a) v ->a
- <@​> lineseq vKP ->1e
a <;> nextstate(main 19101 test.pl​:17) v​:%,*,&,{,x*,x&,x$,$,2147483648 ->b
y <2> aassign[t10] vKS/COMMON ->z
- <1> ex-list lK ->w
b <0> pushmark s ->c
- <1> null lK*/1 ->-
v <@​> leave lKP ->w
c <0> enter l ->d
d <;> nextstate(main 19102 test.pl​:18) v​:%,*,&,{,x*,x&,x$,$,2147483648 ->e
- <1> ex-rv2sv vKM/LVINTRO,STRICT,1 ->f
e <$> gvsv(*@​) s/LVINTRO ->f
f <;> nextstate(main 19102 test.pl​:20) v​:%,*,&,{,x*,x&,x$,$,2147483648 ->g
o <2> sassign vKS/2 ->p
m <@​> anonhash sK*/1 ->n
g <0> pushmark s ->h
h <$> const(PV "rval") s/BARE ->i
- <1> scalar sK/1 ->k
j <@​> leavetry sKP ->k
i <|> entertry(other->j) sK ->2y
2y <;> nextstate(main 19103 test.pl​:20) v​:%,*,&,{,x*,x&,x$,$,2147483648 ->2z
3e <2> leaveloop vKP/2 ->3f
31 <{> enteriter(next->3b last->3e redo->32)[$x​:19104,19107] lK/LVINTRO ->3c
- <0> ex-pushmark s ->2z
- <1> ex-list lKM ->31
2z <0> pushmark sM ->30
30 <$> const(PV "Hello\n") sM ->31
- <1> null vK/1 ->3e
3d <|> and(other->32) vK/1 ->3e
3c <0> iter s ->3d
- <@​> lineseq vKP ->-
32 <;> nextstate(main 19106 test.pl​:21) v​:%,*,&,x*,x&,x$,$,2147483648 ->33
35 <1> entersub[t7] vKS/TARG,STRICT ->36
- <1> ex-list K ->35
33 <0> pushmark s ->34
- <1> ex-rv2cv sK/STRICT,1 ->-
34 <$> gv(*enable_tracing) s ->35
36 <;> nextstate(main 19106 test.pl​:22) v​:%,*,&,x*,x&,x$,$,2147483648 ->37
3a <1> entersub[t8] vKS/TARG,STRICT ->3b
37 <0> pushmark s ->38
38 <0> padsv[$x​:19104,19107] sM ->39
39 <.> method_named(PV "chomp") * ->3a
3b <0> unstack v ->3c
3f <;> nextstate(main 19108 test.pl​:23) v​:%,*,&,{,x*,x&,x$,$,2147483648 ->3g
3g <$> const(IV 1) s ->j
k <$> const(PV "ex") s/BARE ->l
- <1> ex-rv2sv sK/STRICT,1 ->m
l <$> gvsv(*@​) s ->m
n <0> padsv[$x​:19109,19110] sRM*/LVINTRO ->o
p <;> nextstate(main 19110 test.pl​:26) v​:%,*,&,{,x*,x&,x$,$,2147483648 ->q
s <1> entersub[t9] vKS/TARG,STRICT ->t
- <1> ex-list K ->s
q <0> pushmark s ->r
- <1> ex-rv2cv sK/NO(),CONST,STRICT,1 ->-
r <$> gv(*disable_tracing) s ->s
t <;> nextstate(main 19110 test.pl​:27) v​:%,*,&,{,x*,x&,x$,$,2147483648 ->u
u <0> padsv[$x​:19109,19110] s ->v
- <1> ex-list lK ->y
w <0> pushmark s ->x
x <0> padsv[$return​:19111,19112] sPRM*/LVINTRO ->y
z <;> nextstate(main 19112 test.pl​:30) v​:%,*,&,{,x*,x&,x$,$,2147483648 ->10
15 <1> entersub vKS/STRICT ->16
- <1> ex-list K ->15
10 <0> pushmark s ->11
12 <1> not sKM/1 ->13
- <1> ex-helem sK/2 ->12
11 <+> multideref($return->{"rval"}) sK/STRICT ->12
- <0> ex-padsv sM/DREFHV ->11
13 <$> const(PV "Constant from a loop is readonly") sM ->14
- <1> ex-rv2cv sK/STRICT,1 ->-
14 <$> gv(*ok) s ->15
16 <;> nextstate(main 19112 test.pl​:31) v​:%,*,&,{,x*,x&,x$,$,2147483648 ->17
1d <1> entersub vKS/STRICT ->1e
- <1> ex-list K ->1d
17 <0> pushmark s ->18
1b <1> entersub lKMS/LVINTRO,STRICT,INARGS ->1c
- <1> ex-list lK ->1b
18 <0> pushmark s ->19
19 <0> padsv[$return​:19111,19112] sM ->1a
- <1> ex-rv2cv sK/NO(),CONST,STRICT,1 ->-
1a <$> gv(*explain) s ->1b
- <1> ex-rv2cv sK/NO(),CONST,STRICT,1 ->-
1c <$> gv(*note) s ->1d
1f <;> nextstate(main 19113 test.pl​:34) v​:%,*,&,{,x*,x&,x$,$,2147483648 ->1g
2l <2> leaveloop vK/2 ->2m
1g <{> enterloop(next->2l last->2l redo->1h) v ->1h
- <@​> lineseq vKP ->2l
1h <;> nextstate(main 19114 test.pl​:34) v​:%,*,&,{,x*,x&,x$,$,2147483648 ->1i
25 <2> aassign[t17] vKS ->26
- <1> ex-list lK ->23
1i <0> pushmark s ->1j
- <1> null lK*/1 ->-
22 <@​> leave lKP ->23
1j <0> enter l ->1k
1k <;> nextstate(main 19115 test.pl​:35) v​:%,*,&,{,x*,x&,x$,$,2147483648 ->1l
- <1> ex-rv2sv vKM/LVINTRO,STRICT,1 ->1m
1l <$> gvsv(*@​) s/LVINTRO ->1m
1m <;> nextstate(main 19115 test.pl​:37) v​:%,*,&,{,x*,x&,x$,$,2147483648 ->1n
1v <2> sassign vKS/2 ->1w
1t <@​> anonhash sK*/1 ->1u
1n <0> pushmark s ->1o
1o <$> const(PV "rval") s/BARE ->1p
- <1> scalar sK/1 ->1r
1q <@​> leavetry sKP ->1r
1p <|> entertry(other->1q) sK ->2n
2n <;> nextstate(main 19116 test.pl​:38) v​:%,*,&,x*,x&,x$,$,2147483648 ->2o
2q <1> entersub[t13] vKS/TARG,STRICT ->2r
- <1> ex-list K ->2q
2o <0> pushmark s ->2p
- <1> ex-rv2cv sK/STRICT,1 ->-
2p <$> gv(*enable_tracing) s ->2q
2r <;> nextstate(main 19116 test.pl​:39) v​:%,*,&,x*,x&,x$,$,2147483648 ->2s
2v <1> entersub[t15] vKS/TARG,STRICT ->2w
2s <0> pushmark s ->2t
2t <$> const(PV "Hello\n") sM ->2u
2u <.> method_named(PV "chomp") * ->2v
2w <;> nextstate(main 19116 test.pl​:39) v​:%,*,&,{,x*,x&,x$,$,2147483648 ->2x
2x <$> const(IV 1) s ->1q
1r <$> const(PV "ex") s/BARE ->1s
- <1> ex-rv2sv sK/STRICT,1 ->1t
1s <$> gvsv(*@​) s ->1t
1u <0> padsv[$x​:19117,19118] sRM*/LVINTRO ->1v
1w <;> nextstate(main 19118 test.pl​:43) v​:%,*,&,{,x*,x&,x$,$,2147483648 ->1x
1z <1> entersub[t16] vKS/TARG,STRICT ->20
- <1> ex-list K ->1z
1x <0> pushmark s ->1y
- <1> ex-rv2cv sK/STRICT,1 ->-
1y <$> gv(*disable_tracing) s ->1z
20 <;> nextstate(main 19118 test.pl​:44) v​:%,*,&,{,x*,x&,x$,$,2147483648 ->21
21 <0> padsv[$x​:19117,19118] s ->22
- <1> ex-list lK ->25
23 <0> pushmark s ->24
24 <0> padsv[$return​:19119,19120] sPRM*/LVINTRO ->25
26 <;> nextstate(main 19120 test.pl​:47) v​:%,*,&,{,x*,x&,x$,$,2147483648 ->27
2c <1> entersub vKS/STRICT ->2d
- <1> ex-list K ->2c
27 <0> pushmark s ->28
29 <1> not sKM/1 ->2a
- <1> ex-helem sK/2 ->29
28 <+> multideref($return->{"rval"}) sK/STRICT ->29
- <0> ex-padsv sM/DREFHV ->28
2a <$> const(PV "In place constant is readonly") sM ->2b
- <1> ex-rv2cv sK/STRICT,1 ->-
2b <$> gv(*ok) s ->2c
2d <;> nextstate(main 19120 test.pl​:48) v​:%,*,&,{,x*,x&,x$,$,2147483648 ->2e
2k <1> entersub vKS/STRICT ->2l
- <1> ex-list K ->2k
2e <0> pushmark s ->2f
2i <1> entersub lKMS/LVINTRO,STRICT,INARGS ->2j
- <1> ex-list lK ->2i
2f <0> pushmark s ->2g
2g <0> padsv[$return​:19119,19120] sM ->2h
- <1> ex-rv2cv sK/NO(),CONST,STRICT,1 ->-
2h <$> gv(*explain) s ->2i
- <1> ex-rv2cv sK/NO(),CONST,STRICT,1 ->-
2j <$> gv(*note) s ->2k
/tmp/test.pl syntax OK

perl -MO=Concise,-exec -Ilib /tmp/test.pl
1 <0> enter
2 <;> nextstate(main 19096 test.pl​:14) v​:%,*,&,{,x*,x&,x$,$,2147483648
3 <0> pushmark s
4 <$> anoncode[CV ] sRM
5 <1> srefgen sKM/1
6 <$> gv(*set_tracer) s
7 <1> entersub[t2] vKS/TARG,STRICT
8 <;> nextstate(main 19100 test.pl​:34) v​:%,*,&,{,x*,x&,x$,$,2147483648
9 <{> enterloop(next->1e last->1e redo->a) v
a <;> nextstate(main 19101 test.pl​:17) v​:%,*,&,{,x*,x&,x$,$,2147483648
b <0> pushmark s
c <0> enter l
d <;> nextstate(main 19102 test.pl​:18) v​:%,*,&,{,x*,x&,x$,$,2147483648
e <$> gvsv(*@​) s/LVINTRO
f <;> nextstate(main 19102 test.pl​:20) v​:%,*,&,{,x*,x&,x$,$,2147483648
g <0> pushmark s
h <$> const(PV "rval") s/BARE
i <|> entertry(other->j) sK
2y <;> nextstate(main 19103 test.pl​:20) v​:%,*,&,{,x*,x&,x$,$,2147483648
2z <0> pushmark sM
30 <$> const(PV "Hello\n") sM
31 <{> enteriter(next->3b last->3e redo->32)[$x​:19104,19107] lK/LVINTRO
3c <0> iter s
3d <|> and(other->32) vK/1
32 <;> nextstate(main 19106 test.pl​:21) v​:%,*,&,x*,x&,x$,$,2147483648
33 <0> pushmark s
34 <$> gv(*enable_tracing) s
35 <1> entersub[t7] vKS/TARG,STRICT
36 <;> nextstate(main 19106 test.pl​:22) v​:%,*,&,x*,x&,x$,$,2147483648
37 <0> pushmark s
38 <0> padsv[$x​:19104,19107] sM
39 <.> method_named(PV "chomp") *
3a <1> entersub[t8] vKS/TARG,STRICT
3b <0> unstack v
  goto 3c
3e <2> leaveloop vKP/2
3f <;> nextstate(main 19108 test.pl​:23) v​:%,*,&,{,x*,x&,x$,$,2147483648
3g <$> const(IV 1) s
j <@​> leavetry sKP
k <$> const(PV "ex") s/BARE
l <$> gvsv(*@​) s
m <@​> anonhash sK*/1
n <0> padsv[$x​:19109,19110] sRM*/LVINTRO
o <2> sassign vKS/2
p <;> nextstate(main 19110 test.pl​:26) v​:%,*,&,{,x*,x&,x$,$,2147483648
q <0> pushmark s
r <$> gv(*disable_tracing) s
s <1> entersub[t9] vKS/TARG,STRICT
t <;> nextstate(main 19110 test.pl​:27) v​:%,*,&,{,x*,x&,x$,$,2147483648
u <0> padsv[$x​:19109,19110] s
v <@​> leave lKP
w <0> pushmark s
x <0> padsv[$return​:19111,19112] sPRM*/LVINTRO
y <2> aassign[t10] vKS/COMMON
z <;> nextstate(main 19112 test.pl​:30) v​:%,*,&,{,x*,x&,x$,$,2147483648
10 <0> pushmark s
11 <+> multideref($return->{"rval"}) sK/STRICT
12 <1> not sKM/1
13 <$> const(PV "Constant from a loop is readonly") sM
14 <$> gv(*ok) s
15 <1> entersub vKS/STRICT
16 <;> nextstate(main 19112 test.pl​:31) v​:%,*,&,{,x*,x&,x$,$,2147483648
17 <0> pushmark s
18 <0> pushmark s
19 <0> padsv[$return​:19111,19112] sM
1a <$> gv(*explain) s
1b <1> entersub lKMS/LVINTRO,STRICT,INARGS
1c <$> gv(*note) s
1d <1> entersub vKS/STRICT
1e <2> leaveloop vK/2
1f <;> nextstate(main 19113 test.pl​:34) v​:%,*,&,{,x*,x&,x$,$,2147483648
1g <{> enterloop(next->2l last->2l redo->1h) v
1h <;> nextstate(main 19114 test.pl​:34) v​:%,*,&,{,x*,x&,x$,$,2147483648
1i <0> pushmark s
1j <0> enter l
1k <;> nextstate(main 19115 test.pl​:35) v​:%,*,&,{,x*,x&,x$,$,2147483648
1l <$> gvsv(*@​) s/LVINTRO
1m <;> nextstate(main 19115 test.pl​:37) v​:%,*,&,{,x*,x&,x$,$,2147483648
1n <0> pushmark s
1o <$> const(PV "rval") s/BARE
1p <|> entertry(other->1q) sK
2n <;> nextstate(main 19116 test.pl​:38) v​:%,*,&,x*,x&,x$,$,2147483648
2o <0> pushmark s
2p <$> gv(*enable_tracing) s
2q <1> entersub[t13] vKS/TARG,STRICT
2r <;> nextstate(main 19116 test.pl​:39) v​:%,*,&,x*,x&,x$,$,2147483648
2s <0> pushmark s
2t <$> const(PV "Hello\n") sM
2u <.> method_named(PV "chomp") *
2v <1> entersub[t15] vKS/TARG,STRICT
2w <;> nextstate(main 19116 test.pl​:39) v​:%,*,&,{,x*,x&,x$,$,2147483648
2x <$> const(IV 1) s
1q <@​> leavetry sKP
1r <$> const(PV "ex") s/BARE
1s <$> gvsv(*@​) s
1t <@​> anonhash sK*/1
1u <0> padsv[$x​:19117,19118] sRM*/LVINTRO
1v <2> sassign vKS/2
1w <;> nextstate(main 19118 test.pl​:43) v​:%,*,&,{,x*,x&,x$,$,2147483648
1x <0> pushmark s
1y <$> gv(*disable_tracing) s
1z <1> entersub[t16] vKS/TARG,STRICT
20 <;> nextstate(main 19118 test.pl​:44) v​:%,*,&,{,x*,x&,x$,$,2147483648
21 <0> padsv[$x​:19117,19118] s
22 <@​> leave lKP
23 <0> pushmark s
24 <0> padsv[$return​:19119,19120] sPRM*/LVINTRO
25 <2> aassign[t17] vKS
26 <;> nextstate(main 19120 test.pl​:47) v​:%,*,&,{,x*,x&,x$,$,2147483648
27 <0> pushmark s
28 <+> multideref($return->{"rval"}) sK/STRICT
29 <1> not sKM/1
2a <$> const(PV "In place constant is readonly") sM
2b <$> gv(*ok) s
2c <1> entersub vKS/STRICT
2d <;> nextstate(main 19120 test.pl​:48) v​:%,*,&,{,x*,x&,x$,$,2147483648
2e <0> pushmark s
2f <0> pushmark s
2g <0> padsv[$return​:19119,19120] sM
2h <$> gv(*explain) s
2i <1> entersub lKMS/LVINTRO,STRICT,INARGS
2j <$> gv(*note) s
2k <1> entersub vKS/STRICT
2l <2> leaveloop vK/2
2m <@​> leave[1 ref] vKP/REFC
/tmp/test.pl syntax OK

@p5pRT
Copy link
Author

p5pRT commented Jan 23, 2015

From @cpansprout

Both patches applied. Thank you to both of you.

commit 7131132
Author​: Kent Fredric <kentfredric@​gmail.com>
Date​: Thu Jan 22 23​:15​:51 2015 +1300

  Add test for glob constants accepting method calls
 
  This specific case tripped up autobox.pm.

commit c18e654
Author​: Leon Timmermans <fawaka@​gmail.com>
Date​: Wed Jan 21 23​:43​:36 2015 +0100

  [perl #123619] Only make stringy classnames shared
 
  This caused failures in autobox that expect their invocant to be something
  other than a string (e.g. a number). See also [cpan #100819].

On Thu Jan 22 05​:21​:54 2015, kentfredric wrote​:

Having applied these patches, autobox now installs, however, a
subsequent error appears in Moose​::Autobox with string handling.

Namely,

("Hello\n")->chomp

Is expected to die due to readonly modification. However, it doesn't.

This​:

for my $x (q(Hello\n)) {
$x->chomp
}

Does still die however.

Hmmm. That affects pure-Perl cases, too​:

$ ./perl -Ilib -e 'sub UNIVERSAL​::undef { undef $_[0] } "Hello"->undef'
$ perl5.20.1 -e 'sub UNIVERSAL​::undef { undef $_[0] } "Hello"->undef'
Modification of a read-only value attempted at -e line 1.

Can we just make the new scalar read-only? What about referential identity? I think we need to modify the scalar in place. But it is going to be marked read-only already at this point. I think if it is a regular COW it is safe to convert it into a shared-hash COW, which would cover the vast majority of code that benefits from this optimisation.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Mar 7, 2015

From @jkeenan

On Thu Jan 22 22​:23​:42 2015, sprout wrote​:

Both patches applied. Thank you to both of you.

commit 7131132
Author​: Kent Fredric <kentfredric@​gmail.com>
Date​: Thu Jan 22 23​:15​:51 2015 +1300

Add test for glob constants accepting method calls

This specific case tripped up autobox.pm.

commit c18e654
Author​: Leon Timmermans <fawaka@​gmail.com>
Date​: Wed Jan 21 23​:43​:36 2015 +0100

[perl #123619] Only make stringy classnames shared

This caused failures in autobox that expect their invocant to be
something
other than a string (e.g. a number). See also [cpan #100819].

On Thu Jan 22 05​:21​:54 2015, kentfredric wrote​:

Having applied these patches, autobox now installs, however, a
subsequent error appears in Moose​::Autobox with string handling.

Namely,

("Hello\n")->chomp

Is expected to die due to readonly modification. However, it doesn't.

This​:

for my $x (q(Hello\n)) {
$x->chomp
}

Does still die however.

Hmmm. That affects pure-Perl cases, too​:

$ ./perl -Ilib -e 'sub UNIVERSAL​::undef { undef $_[0] } "Hello"-

undef'
$ perl5.20.1 -e 'sub UNIVERSAL​::undef { undef $_[0] } "Hello"->undef'
Modification of a read-only value attempted at -e line 1.

Can we just make the new scalar read-only? What about referential
identity? I think we need to modify the scalar in place. But it is
going to be marked read-only already at this point. I think if it is
a regular COW it is safe to convert it into a shared-hash COW, which
would cover the vast majority of code that benefits from this
optimisation.

autobox now appears to be PASSing on blead. See, e.g., http​://matrix.cpantesters.org/?dist=autobox+2.83

Does this make this ticket closable?

Or, if there are issues other than whether autobox is passing or not, can we remove it from the list of tickets blocking 5.22?

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Mar 7, 2015

From @karenetheridge

On Fri Mar 06 18​:54​:36 2015, jkeenan wrote​:

autobox now appears to be PASSing on blead. See, e.g.,
http​://matrix.cpantesters.org/?dist=autobox+2.83

Does this make this ticket closable?

Or, if there are issues other than whether autobox is passing or not,
can we remove it from the list of tickets blocking 5.22?

Thank you very much.

Moose​::Autobox still has problems on 5.21.9​: https://rt.perl.org/Public/Bug/Display.html?id=123619#txn-1327901

@p5pRT
Copy link
Author

p5pRT commented Apr 9, 2015

From @iabyn

On Sat, Mar 07, 2015 at 12​:42​:44AM -0800, Karen Etheridge via RT wrote​:

On Fri Mar 06 18​:54​:36 2015, jkeenan wrote​:

autobox now appears to be PASSing on blead. See, e.g.,
http​://matrix.cpantesters.org/?dist=autobox+2.83

Does this make this ticket closable?

Or, if there are issues other than whether autobox is passing or not,
can we remove it from the list of tickets blocking 5.22?

Thank you very much.

Moose​::Autobox still has problems on 5.21.9​: https://rt.perl.org/Public/Bug/Display.html?id=123619#txn-1327901

Now fixed with

commit b99dfd9
Author​: David Mitchell <davem@​iabyn.com>
AuthorDate​: Thu Apr 9 10​:50​:51 2015 +0100
Commit​: David Mitchell <davem@​iabyn.com>
CommitDate​: Thu Apr 9 10​:53​:04 2015 +0100

  keep FOO read-only in 'FOO'->f()
 
  RT #123619
 
  The new method code (d648ffc) was replacing the const SV attached to
  the const op with a shared-string version, but was failing to make the new
  SV read-only.

--
I don't want to achieve immortality through my work...
I want to achieve it through not dying.
  -- Woody Allen

@p5pRT
Copy link
Author

p5pRT commented Apr 9, 2015

@iabyn - Status changed from 'open' to 'pending release'

@p5pRT
Copy link
Author

p5pRT commented Jun 2, 2015

From @khwilliamson

Thanks for submitting this ticket

The issue should be resolved with the release today of Perl v5.22, available at http​://www.perl.org/get.html
If you find that the problem persists, feel free to reopen this ticket

--
Karl Williamson for the Perl 5 porters team

@p5pRT
Copy link
Author

p5pRT commented Jun 2, 2015

@khwilliamson - Status changed from 'pending release' to 'resolved'

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