The following program segfaults after 510 iterations:

    .sub _main
        $I0 = 0
    again:
        $S1 = "anon"
        $S0 = $I0
        inc $I0
        concat $S1, $S0
        newclass $P0, $S1
        find_type $I2, $S1
        print $I2
        print "\n"
        if $I0 < 1000 goto again
        end
    .end

It runs fine if I C<sweepoff> at the beginning, and indeed, it dies
during DOD, since bucket points to an invalid memory location.  I
haven't the slightest clue what's wrong beyond that.

Here's the gdb backtrace:

#0  0x080809d2 in mark_hash (interpreter=0x826f9b0, hash=0x8dfb38) at src/hash.c:297
297                     (hash->mark_key)(interpreter, (PObj *)bucket->key);
(gdb) bt
#0  0x080809d2 in mark_hash (interpreter=0x826f9b0, hash=0x8dfb38) at src/hash.c:297
#1  0x081cfabb in Parrot_PerlHash_mark (interpreter=0x826f9b0, pmc=0x8dfb50) at 
perlhash.c:62
#2  0x081fefcf in Parrot_OrderedHash_mark (interpreter=0x826f9b0, pmc=0x8dfb50) at 
orderedhash.c:57
#3  0x080b764c in trace_children (interpreter=0x826f9b0, current=0x8dfb50) at 
src/dod.c:251
#4  0x080b74ea in trace_active_PMCs (interpreter=0x826f9b0, trace_stack=1) at 
src/dod.c:201
#5  0x080b7cad in Parrot_do_dod_run (interpreter=0x826f9b0, trace_stack=1) at 
src/dod.c:744
#6  0x081f0ba7 in more_traceable_objects (interpreter=0x826f9b0, pool=0x8277170) at 
src/smallobject.c:71
#7  0x081f0cbc in get_free_object (interpreter=0x826f9b0, pool=0x8277170) at 
src/smallobject.c:134
#8  0x080b66a7 in get_free_buffer (interpreter=0x826f9b0, pool=0x8277170) at 
src/headers.c:55
#9  0x080b6be6 in new_bufferlike_header (interpreter=0x826f9b0, size=60) at 
src/headers.c:250
#10 0x08080f46 in new_hash_x (interpreter=0x826f9b0, hptr=0x8dfb50, 
val_type=enum_type_PMC, val_size=0,
    hkey_type=Hash_key_type_ascii, compare=0x8080565 <STRING_compare>, 
keyhash=0x8080518 <key_hash_STRING>,
    mark=0x80b71d8 <pobject_lives>) at src/hash.c:516
#11 0x08080f05 in new_hash (interpreter=0x826f9b0, hptr=0x8dfb50) at src/hash.c:477
#12 0x081cfa92 in Parrot_PerlHash_init (interpreter=0x826f9b0, pmc=0x8dfb50) at 
perlhash.c:55
#13 0x081fefa5 in Parrot_OrderedHash_init (interpreter=0x826f9b0, pmc=0x8dfb50) at 
orderedhash.c:50
#14 0x0807ed8a in pmc_new (interpreter=0x826f9b0, base_type=23) at src/pmc.c:51
#15 0x081ecfd0 in Parrot_new_class (interpreter=0x826f9b0, class=0x8dfbb0, 
class_name=0x9a7e70) at src/objects.c:131
#16 0x080cefda in Parrot_newclass_p_s (cur_opcode=0x8291608, interpreter=0x826f9b0) at 
object.ops:123
#17 0x0807e1c5 in runops_slow_core (interpreter=0x826f9b0, pc=0x8291608) at 
src/runops_cores.c:115
#18 0x080753b3 in runops_int (interpreter=0x826f9b0, offset=0) at src/interpreter.c:628
#19 0x08075455 in runops_ex (interpreter=0x826f9b0, offset=0) at src/interpreter.c:650
#20 0x08075606 in runops (interpreter=0x826f9b0, offset=0) at src/interpreter.c:701
#21 0x080b0ad5 in Parrot_runcode (interpreter=0x826f9b0, argc=1, argv=0xb8dcf16c) at 
src/embed.c:513
#22 0x08074611 in main (argc=1, argv=0xb8dcf16c) at imcc/main.c:548
#23 0x00232ba7 in __libc_start_main () from /lib/libc.so.6

gcc version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r1, propolice)

Luke

Reply via email to