# New Ticket Created by  Moritz Lenz 
# Please include the string:  [perl #66816]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=66816 >


This innocently looking script on Rakudo #18 sends the GC into an infinite
recursion and thus provokes a segmentation fault:

use v6;
my $str = "a\nbc\nd";
say $str.subst(/^^/, '# ', :g);

The backtrace looks like this:
(gdb) bt
#0  0x00007f95a5c86e55 in mark_special (interp=0x176e010, obj=0x25a8180)
    at src/gc/mark_sweep.c:460
#1  0x00007f95a5c84633 in Parrot_gc_mark_PObj_alive (interp=0x176e010,
    obj=0x25a8180) at src/gc/api.c:162
#2  0x00007f95a5cf725b in mark_context (interp=0x176e010, ctx=0x1fd0250)
    at src/sub.c:91
#3  0x00007f95a5dbdb8f in Parrot_Sub_mark (interp=0x176e010, pmc=0x25a81b0)
    at ./src/pmc/sub.pmc:505
#4  0x00007f95a5dc0b82 in Parrot_Coroutine_mark (interp=0x176e010,
    pmc=0x25a81b0) at ./src/pmc/coroutine.pmc:264
#5  0x00007f95a5c86e57 in mark_special (interp=0x176e010, obj=0x25a81b0)
    at src/gc/mark_sweep.c:460

and so on, repeating the first five lines all over again.

Cheers,
Moritz

-- 
Moritz Lenz
http://perlgeek.de/ |  http://perl-6.de/ | http://sudokugarden.de/

Reply via email to