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



 This code segfaults:

      sweepoff
      set I0, 0

LOOP: new P0, .PerlString
      set P0, "ABC"
      save P0
      inc I0
      lt I0, 127, LOOP

      end

 It doesn't so this if you remove the <sweepoff>, or if you make the
 number in the loop smaller, which suggests that it's crashing when it
 runs out of headers to allocate.

 Here's the stack trace:

Program received signal SIGSEGV, Segmentation fault.
0x080aa242 in get_free_buffer (interpreter=0x8133be8, pool=0x813c008)
    at headers.c:84
84          pool->free_list = *(void **)buffer;
(gdb) bt
#0  0x080aa242 in get_free_buffer (interpreter=0x8133be8, pool=0x813c008)
    at headers.c:84
#1  0x080aa56e in new_string_header (interpreter=0x8133be8, flags=0)
    at headers.c:216
#2  0x0807c1a9 in string_copy (interpreter=0x8133be8, s=0x8147be0)
    at string.c:225
#3  0x080bbf64 in Parrot_PerlString_set_string_native ()
#4  0x080899b4 in cg_core (cur_opcode=0x8149c64, interpreter=0x8133be8)
    at core.ops:583
#5  0x0807d7f0 in runops_cgoto_core (interpreter=0x8133be8, pc=0x8149c48)
    at runops_cores.c:52
#6  0x08049942 in runops_generic (core=0x807d7dc <runops_cgoto_core>,
    interpreter=0x8133be8, pc=0x8149c48) at interpreter.c:80
#7  0x0804a18d in runops (interpreter=0x8133be8, code=0x8145b48, offset=0)
    at interpreter.c:474
#8  0x0808592a in Parrot_runcode (interpreter=0x8133be8, argc=1,
    argv=0xbfffe148) at embed.c:304
#9  0x080bf38a in main (argc=1, argv=0xbfffe148) at test_main.c:49
#10 0x400b4627 in __libc_start_main (main=0x80bf2f8 <main>, argc=2,
    ubp_av=0xbfffe144, init=0x8048e34 <_init>, fini=0x80bf650 <_fini>,
    rtld_fini=0x4000dcc4 <_dl_fini>, stack_end=0xbfffe13c)
    at ../sysdeps/generic/libc-start.c:129

 Simon



Reply via email to