# New Ticket Created by Moritz Lenz
# Please include the string: [perl #64208]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=64208 >
In a parser I am writing I see a segmentation fault that shows up on a
piece of code like this:
method value($/, $what) {
when * { make 1 } ;
}
(adding a given $what { ... } around it makes no difference). When I
write instead a simple 'make 1' or 'do { do { make 1 } }', it does not
segfault.
To reproduce this problem, do these steps:
git clone git://github.com/moritz/json.git
cd json
PERL6LIB=/path/to/your/rakudo/dir perl6 t/structure.t
This is the backtrace I get from running it with gdb:
[New Thread 0x7f47461b06f0 (LWP 25506)]
1..1
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f47461b06f0 (LWP 25506)]
0x00007f4745908920 in Parrot_callmethodcc_p_sc (cur_opcode=0x7f4746007390,
interp=0x237a010) at src/ops/object.ops:59
59 PMC * const method_pmc = VTABLE_find_method(interp,
object, meth);
(gdb) bt
#0 0x00007f4745908920 in Parrot_callmethodcc_p_sc
(cur_opcode=0x7f4746007390,
interp=0x237a010) at src/ops/object.ops:59
#1 0x00007f47459dcf85 in runops_slow_core (interp=0x237a010,
pc=0x7f4746007390) at src/runops_cores.c:461
#2 0x00007f474598a315 in runops_int (interp=0x237a010, offset=468)
at src/interpreter.c:980
#3 0x00007f474598ae1a in runops (interp=0x237a010, offs=468)
at src/call/ops.c:107
#4 0x00007f474598b1f6 in runops_args (interp=0x237a010,
sub=0x7f4741bda090,
obj=0x2405810, meth_unused=0x0, sig=0x7f4745c17124 "vP",
ap=0x7fff4e1d7270)
at src/call/ops.c:254
#5 0x00007f474598c5ac in Parrot_runops_fromc_args (interp=0x237a010,
sub=0x7f4741bda090, sig=0x7f4745c17124 "vP") at src/call/ops.c:321
#6 0x00007f474596979f in Parrot_ex_throw_from_c (interp=0x237a010,
exception=0x7f4741bd9f70) at src/exceptions.c:341
#7 0x00007f4745969974 in Parrot_ex_throw_from_c_args (interp=0x237a010,
ret_addr_unused=0x0, exitcode=51,
format=0x7f4745c1e790 "can't convert unicode string to ascii")
at src/exceptions.c:410
#8 0x00007f4745a84003 in to_ascii (interp=0x237a010, src=0x4707528,
dest=0x47074e0) at src/string/charset/ascii.c:279
#9 0x00007f4745a84989 in to_charset (interp=0x237a010, src=0x4707528,
dest=0x47074e0) at src/string/charset/ascii.c:340
#10 0x00007f47458e89e1 in Parrot_str_change_charset (interp=0x237a010,
src=0x4707528, charset_nr=0, dest=0x47074e0) at src/string/api.c:2963
#11 0x00007f474590feca in Parrot_trans_charset_s_s_i (
cur_opcode=0x7f4740e77028, interp=0x237a010) at src/ops/string.ops:555
#12 0x00007f47459dcf85 in runops_slow_core (interp=0x237a010,
pc=0x7f4740e77028) at src/runops_cores.c:461
#13 0x00007f474598a315 in runops_int (interp=0x237a010, offset=21854)
at src/interpreter.c:980
#14 0x00007f474598ae1a in runops (interp=0x237a010, offs=21854)
at src/call/ops.c:107
#15 0x00007f474598b1f6 in runops_args (interp=0x237a010,
sub=0x7f4742c28390,
obj=0x2405810, meth_unused=0x0, sig=0x7f4745c168ab "vP",
ap=0x7fff4e1d77a0)
at src/call/ops.c:254
#16 0x00007f474598c5ac in Parrot_runops_fromc_args (interp=0x237a010,
sub=0x7f4742c28390, sig=0x7f4745c168ab "vP") at src/call/ops.c:321
#17 0x00007f4745965d3e in Parrot_runcode (interp=0x237a010, argc=2,
argv=0x7fff4e1d79d8) at src/embed.c:1011
#18 0x0000000000400cbd in main ()
Cheers,
Moritz