Raku / old-issue-tracker

Tickets from RT
https://github.com/Raku/old-issue-tracker/issues
2 stars 1 forks source link

Failure when defining infix:<+=> #1235

Closed p6rt closed 14 years ago

p6rt commented 15 years ago

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

Searchable as RT68662$

p6rt commented 15 years ago

From vetinari@ankh-morp.org

$ uname -a Linux hex 2.6.26-2-amd64 #​1 SMP Sun Jul 26 20​:35​:48 UTC 2009 x86_64 GNU/Linux

Same on i386, both debian "lenny"

$ gdb --args ./perl6 -e 'multi sub infix​:\<+=> (Num $a, Num $b) { $a -= $b }' GNU gdb 6.8-debian Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+​: GNU GPL version 3 or later \http://gnu.org/licenses/gpl.html This is free software​: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu"... (gdb) run Starting program​: /home/hanno/projects/rakudo/perl6 -e multi\ sub\ infix​:\\<+=\>\ \(Num\ \$a,\ Num\ \$b\)\ \{\ \$a\ -=\ \$b\ \} [Thread debugging using libthread_db enabled] warning​: Lowest section in /usr/lib/libicudata.so.36 is .hash at 0000000000000120 [New Thread 0x7f1098bbe6f0 (LWP 3810)]

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7f1098bbe6f0 (LWP 3810)] 0x00007f10986312ab in Parrot_Exception_set_attr_str (interp=0x1cda010,   pmc=0x7f10938aebc0, name=0x1cdcd60, value=0x0)   at ./src/pmc/exception.pmc​:663 663 if (VTABLE_isa(interp, value, CONST_STRING(interp, "Continuation"))) { (gdb) bt

​0 0x00007f10986312ab in Parrot_Exception_set_attr_str (interp=0x1cda010,

  pmc=0x7f10938aebc0, name=0x1cdcd60, value=0x0)   at ./src/pmc/exception.pmc​:663

​1 0x00007f10984f0e5b in Parrot_ex_throw_from_c (interp=0x1cda010,

  exception=0x7f10938aebc0) at src/exceptions.c​:378

​2 0x00007f10984f1104 in Parrot_ex_throw_from_c_args (interp=0x1cda010,

  ret_addr_unused=0x0, exitcode=37,   format=0x7f1098743a38 "%s() not implemented in class '%Ss'")   at src/exceptions.c​:460

​3 0x00007f1098621f1a in cant_do_method (interp=0x1cda010,

  pmc=0x7f10949feb30, methname=0x7f1098743903 "push_pmc")   at ./src/pmc/default.pmc​:64

​4 0x00007f10986227b8 in Parrot_default_push_pmc (interp=0x1cda010,

  pmc=0x7f10949feb30, value=0x7f10938b1500) at ./src/pmc/default.c​:2204

​5 0x00007f10985047a0 in store_sub_in_multi (interp=0x1cda010,

  sub_pmc=0x7f10938b1500, ns=0x1dccf60) at src/global.c​:836

​6 0x00007f1098505451 in Parrot_store_sub_in_namespace (interp=0x1cda010,

  sub_pmc=0x7f10938b1500) at src/global.c​:874

​7 0x00007f10987211d7 in add_const_pmc_sub (interp=0x1cda010, r=0x3221900,

  offs=65, end=201) at compilers/imcc/pbc.c​:1505

​8 0x00007f10987228a6 in e_pbc_emit (interp=0x1cda010, param_unused=0x0,

  unit=0x3221700, ins=0x32219b0) at compilers/imcc/pbc.c​:2199

​9 0x00007f1098712ca9 in emit_flush (interp=0x1cda010, param=0x0,

  unit=0x3221700) at compilers/imcc/instructions.c​:909

​10 0x00007f109870d008 in imc_compile_unit (interp=0x1cda010, unit=0x3221700)

  at compilers/imcc/imc.c​:123

​11 0x00007f109870d05b in imc_close_unit (interp=0x1cda010, unit=0x3221700)

  at compilers/imcc/imc.c​:235

​12 0x00007f10986feef1 in yyparse (yyscanner=0x3217850, interp=0x1cda010)

  at compilers/imcc/imcc.y​:1157

​13 0x00007f1098705231 in compile_string (interp=0x1cda010,

  s=0x3216a90 "\n.HLL \"perl6\"\n\n.namespace []\n.sub \"_block18\" :main :anon :subid(\"12_1250671036\")\n .param pmc param_50 :slurpy\n.annotate \"line\", 0\n .const 'Sub' $P52 = \"15_1250671036\" \n capture_lex $P52\n.anno"..., yyscanner=0x3217850) at compilers/imcc/imcc.l​:1369

​14 0x00007f1098724401 in imcc_compile (interp=0x1cda010,

  s=0x3216a90 "\n.HLL \"perl6\"\n\n.namespace []\n.sub \"_block18\" :main :anon :subid(\"12_1250671036\")\n .param pmc param_50 :slurpy\n.annotate \"line\", 0\n .const 'Sub' $P52 = \"15_1250671036\" \n capture_lex $P52\n.anno"..., pasm_file=0, error_message=0x7fffa0be2bf0)   at compilers/imcc/parser_util.c​:683

​15 0x00007f1098724710 in imcc_compile_pir_ex (interp=0x1cda010,

  s=0x3216a90 "\n.HLL \"perl6\"\n\n.namespace []\n.sub \"_block18\" :main :anon :subid(\"12_1250671036\")\n .param pmc param_50 :slurpy\n.annotate \"line\", 0\n .const 'Sub' $P52 = \"15_1250671036\" \n capture_lex $P52\n.anno"...) at compilers/imcc/parser_util.c​:876

​16 0x00007f1098536218 in pcf_P_Jt (interp=0x1cda010, self=0x1dcd200)

  at src/nci.c​:237

​17 0x00007f109863f7d8 in Parrot_NCI_invoke (interp=0x1cda010, pmc=0x1dcd200,

  next=0x7f1098bd0eb0) at ./src/pmc/nci.pmc​:335

​18 0x00007f1098473d9c in Parrot_invokecc_p (cur_opcode=0x7f1098bd0ea0,

  interp=0x1cda010) at src/ops/core.ops​:504

​19 0x00007f109856b238 in runops_slow_core (interp=0x1cda010,

  pc=0x7f1098bd0ea0) at src/runcore/cores.c​:462

​20 0x00007f1098569f19 in runops_int (interp=0x1cda010, offset=289392)

  at src/runcore/main.c​:987

​21 0x00007f109851216c in runops (interp=0x1cda010, offs=289392)

  at src/call/ops.c​:119

​22 0x00007f1098512556 in runops_args (interp=0x1cda010, sub=0x7f10949e3e90,

  obj=0x1d60950, meth_unused=0x0, sig=0x7f10987395cb "vP", ap=0x7fffa0be2f70)   at src/call/ops.c​:269

​23 0x00007f109851390c in Parrot_runops_fromc_args (interp=0x1cda010,

  sub=0x7f10949e3e90, sig=0x7f10987395cb "vP") at src/call/ops.c​:338

​24 0x00007f10984ed461 in Parrot_runcode (interp=0x1cda010, argc=3,

  argv=0x7fffa0be31b8) at src/embed.c​:1021

​25 0x0000000000400cfb in main ()

(gdb)

p6rt commented 15 years ago

From frioux@gmail.com

No longer segfaults, but still fails. Test added in SVN #​28114.

p6rt commented 15 years ago

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S06-operator-overloading/sub.t

commit 34184fb3629630d8b8c0e2f0bb15b23652ea9dcd Author​: frew \frew@&#8203;c213334d\-75ef\-0310\-aa23\-eaa082d1ae64 Date​: Sat Aug 29 20​:41​:15 2009 +0000

  add test for RT68662  
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;28114 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch ```diff diff --git a/t/spec/S06-operator-overloading/sub.t b/t/spec/S06-operator-overloading/sub.t index 9ef6ee6..64657f9 100644 --- a/t/spec/S06-operator-overloading/sub.t +++ b/t/spec/S06-operator-overloading/sub.t @@ -103,7 +103,7 @@ Testing operator overloading subroutines { sub postfix: ($wobble) { return "ANDANDAND$wobble"; }; - is("boop"W, "ANDANDANDboop", + is("boop"W, "ANDANDANDboop", 'postfix operator overloading for new operator'); } @@ -294,4 +294,12 @@ Testing operator overloading subroutines } +#?rakudo skip 'RT #68662' +{ + multi sub infix:<+=> (Num $a, Num $b) { $a -= $b } + my $frew = 10; + $frew += 5; + is $frew, 15, 'infix redefinition of += works'; +} + # vim: ft=perl6 ```
p6rt commented 15 years ago

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

p6rt commented 14 years ago

From @coke

On Sat Aug 29 13​:45​:42 2009, KyleHa wrote​:

This is an automatically generated mail to inform you that tests are now available in t/spec/S06-operator-overloading/sub.t

commit 34184fb3629630d8b8c0e2f0bb15b23652ea9dcd Author​: frew \frew@&#8203;c213334d\-75ef\-0310\-aa23\-eaa082d1ae64 Date​: Sat Aug 29 20​:41​:15 2009 +0000

add test for RT68662

git\-svn\-id&#8203;: http://svn.pugscode.org/pugs@&#8203;28114 c213334d\-75ef\-0310\-

aa23-eaa082d1ae64

diff --git a/t/spec/S06-operator-overloading/sub.t b/t/spec/S06- operator-overloading/sub.t index 9ef6ee6..64657f9 100644 --- a/t/spec/S06-operator-overloading/sub.t +++ b/t/spec/S06-operator-overloading/sub.t @​@​ -103,7 +103,7 @​@​ Testing operator overloading subroutines { sub postfix​:\ ($wobble) { return "ANDANDAND$wobble"; };

- is("boop"W, "ANDANDANDboop", + is("boop"W, "ANDANDANDboop", 'postfix operator overloading for new operator'); }

@​@​ -294,4 +294,12 @​@​ Testing operator overloading subroutines

}

+#?rakudo skip 'RT #​68662' +{ + multi sub infix​:\<+=> (Num $a, Num $b) { $a -= $b } + my $frew = 10; + $frew += 5; + is $frew, 15, 'infix redefinition of += works'; +} + # vim​: ft=perl6

Actual test now reads​:

#?rakudo skip 'RT #​68662' {   multi sub infix​:\<+=> (Num $a, Num $b) { $a -= $b }   my $frew = 10;   $frew += 5;   is $frew, 5, 'infix redefinition of += works'; }

-- Will "Coke" Coleda

p6rt commented 14 years ago

From @coke

Test was wrong, updated it with a hint from quester. Looks like it should be working now. Can't test it due to build failures in rakudo atm, though.

-- Will "Coke" Coleda

p6rt commented 14 years ago

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