pmichaud and I figured today that the segfaulting in 06-grammar.t is
caused by optimization, with the --optimize flag.
However, it's not all the fault of --optimize. I've been working on
valgrind, and there's some invalid memory accessing going on.
There's a dump following. The key is in the call to test.'plan'(1).
If that line is removed, valgrind runs clean. If it's in there, then
you get the dump as shown. Note that this parrot is built WITHOUT --
optimize, and we still get the valgrind failures.
I hope this provides some clues.
xoxo,
Andy
[EMAIL PROTECTED]/parrot]$ cat foo.t
#!./parrot
.sub main :main
load_bytecode 'Test/Builder.pir'
.local pmc test
test = new 'Test::Builder'
test.'plan'(1)
.end
# vi: ft=pir
[EMAIL PROTECTED]/parrot]$ valgrind ./parrot foo.t
==1002== Memcheck, a memory error detector.
==1002== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al.
==1002== Using LibVEX rev 1658, a library for dynamic binary
translation.
==1002== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP.
==1002== Using valgrind-3.2.1, a dynamic binary instrumentation
framework.
==1002== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al.
==1002== For more details, rerun with: -v
==1002==
==1002== Conditional jump or move depends on uninitialised value(s)
==1002== at 0x4E722BF: trace_mem_block (dod.c:765)
==1002== by 0x4E901CE: trace_system_stack (cpu_dep.c:110)
==1002== by 0x4E9018F: trace_system_areas (cpu_dep.c:94)
==1002== by 0x4E71904: Parrot_dod_trace_root (dod.c:303)
==1002== by 0x4E7194A: trace_active_PMCs (dod.c:324)
==1002== by 0x4E72724: Parrot_dod_ms_run (dod.c:972)
==1002== by 0x4E72827: Parrot_do_dod_run (dod.c:1022)
==1002== by 0x4E708BB: more_traceable_objects (smallobject.c:101)
==1002== by 0x4E7095E: gc_ms_get_free_object (smallobject.c:146)
==1002== by 0x4E6E881: get_free_buffer (headers.c:48)
==1002== by 0x4E6EEBC: new_string_header (headers.c:320)
==1002== by 0x4E5505C: string_make_direct (string.c:587)
==1002==
==1002== Conditional jump or move depends on uninitialised value(s)
==1002== at 0x4E722D0: trace_mem_block (dod.c:770)
==1002== by 0x4E901CE: trace_system_stack (cpu_dep.c:110)
==1002== by 0x4E9018F: trace_system_areas (cpu_dep.c:94)
==1002== by 0x4E71904: Parrot_dod_trace_root (dod.c:303)
==1002== by 0x4E7194A: trace_active_PMCs (dod.c:324)
==1002== by 0x4E72724: Parrot_dod_ms_run (dod.c:972)
==1002== by 0x4E72827: Parrot_do_dod_run (dod.c:1022)
==1002== by 0x4E708BB: more_traceable_objects (smallobject.c:101)
==1002== by 0x4E7095E: gc_ms_get_free_object (smallobject.c:146)
==1002== by 0x4E6E881: get_free_buffer (headers.c:48)
==1002== by 0x4E6EEBC: new_string_header (headers.c:320)
==1002== by 0x4E5505C: string_make_direct (string.c:587)
==1002==
==1002== Conditional jump or move depends on uninitialised value(s)
==1002== at 0x4E72304: trace_mem_block (dod.c:777)
==1002== by 0x4E901CE: trace_system_stack (cpu_dep.c:110)
==1002== by 0x4E9018F: trace_system_areas (cpu_dep.c:94)
==1002== by 0x4E71904: Parrot_dod_trace_root (dod.c:303)
==1002== by 0x4E7194A: trace_active_PMCs (dod.c:324)
==1002== by 0x4E72724: Parrot_dod_ms_run (dod.c:972)
==1002== by 0x4E72827: Parrot_do_dod_run (dod.c:1022)
==1002== by 0x4E708BB: more_traceable_objects (smallobject.c:101)
==1002== by 0x4E7095E: gc_ms_get_free_object (smallobject.c:146)
==1002== by 0x4E6E881: get_free_buffer (headers.c:48)
==1002== by 0x4E6EEBC: new_string_header (headers.c:320)
==1002== by 0x4E5505C: string_make_direct (string.c:587)
==1002==
==1002== Conditional jump or move depends on uninitialised value(s)
==1002== at 0x4E722DA: trace_mem_block (dod.c:770)
==1002== by 0x4E901CE: trace_system_stack (cpu_dep.c:110)
==1002== by 0x4E9018F: trace_system_areas (cpu_dep.c:94)
==1002== by 0x4E71904: Parrot_dod_trace_root (dod.c:303)
==1002== by 0x4E7194A: trace_active_PMCs (dod.c:324)
==1002== by 0x4E72724: Parrot_dod_ms_run (dod.c:972)
==1002== by 0x4E72827: Parrot_do_dod_run (dod.c:1022)
==1002== by 0x4E708BB: more_traceable_objects (smallobject.c:101)
==1002== by 0x4E7095E: gc_ms_get_free_object (smallobject.c:146)
==1002== by 0x4E6E881: get_free_buffer (headers.c:48)
==1002== by 0x4E6EEBC: new_string_header (headers.c:320)
==1002== by 0x4E5505C: string_make_direct (string.c:587)
==1002==
==1002== Conditional jump or move depends on uninitialised value(s)
==1002== at 0x4E7230E: trace_mem_block (dod.c:777)
==1002== by 0x4E901CE: trace_system_stack (cpu_dep.c:110)
==1002== by 0x4E9018F: trace_system_areas (cpu_dep.c:94)
==1002== by 0x4E71904: Parrot_dod_trace_root (dod.c:303)
==1002== by 0x4E7194A: trace_active_PMCs (dod.c:324)
==1002== by 0x4E72724: Parrot_dod_ms_run (dod.c:972)
==1002== by 0x4E72827: Parrot_do_dod_run (dod.c:1022)
==1002== by 0x4E708BB: more_traceable_objects (smallobject.c:101)
==1002== by 0x4E7095E: gc_ms_get_free_object (smallobject.c:146)
==1002== by 0x4E6E881: get_free_buffer (headers.c:48)
==1002== by 0x4E6EEBC: new_string_header (headers.c:320)
==1002== by 0x4E5505C: string_make_direct (string.c:587)
==1002==
==1002== Conditional jump or move depends on uninitialised value(s)
==1002== at 0x4E70767: contained_in_pool (smallobject.c:54)
==1002== by 0x4E6F171: is_buffer_ptr (headers.c:462)
==1002== by 0x4E7231C: trace_mem_block (dod.c:777)
==1002== by 0x4E901CE: trace_system_stack (cpu_dep.c:110)
==1002== by 0x4E9018F: trace_system_areas (cpu_dep.c:94)
==1002== by 0x4E71904: Parrot_dod_trace_root (dod.c:303)
==1002== by 0x4E7194A: trace_active_PMCs (dod.c:324)
==1002== by 0x4E72724: Parrot_dod_ms_run (dod.c:972)
==1002== by 0x4E72827: Parrot_do_dod_run (dod.c:1022)
==1002== by 0x4E708BB: more_traceable_objects (smallobject.c:101)
==1002== by 0x4E7095E: gc_ms_get_free_object (smallobject.c:146)
==1002== by 0x4E6E881: get_free_buffer (headers.c:48)
==1002==
==1002== Conditional jump or move depends on uninitialised value(s)
==1002== at 0x4E70780: contained_in_pool (smallobject.c:54)
==1002== by 0x4E6F171: is_buffer_ptr (headers.c:462)
==1002== by 0x4E7231C: trace_mem_block (dod.c:777)
==1002== by 0x4E901CE: trace_system_stack (cpu_dep.c:110)
==1002== by 0x4E9018F: trace_system_areas (cpu_dep.c:94)
==1002== by 0x4E71904: Parrot_dod_trace_root (dod.c:303)
==1002== by 0x4E7194A: trace_active_PMCs (dod.c:324)
==1002== by 0x4E72724: Parrot_dod_ms_run (dod.c:972)
==1002== by 0x4E72827: Parrot_do_dod_run (dod.c:1022)
==1002== by 0x4E708BB: more_traceable_objects (smallobject.c:101)
==1002== by 0x4E7095E: gc_ms_get_free_object (smallobject.c:146)
==1002== by 0x4E6E881: get_free_buffer (headers.c:48)
==1002==
==1002== Conditional jump or move depends on uninitialised value(s)
==1002== at 0x4E707A4: contained_in_pool (smallobject.c:54)
==1002== by 0x4E6F171: is_buffer_ptr (headers.c:462)
==1002== by 0x4E7231C: trace_mem_block (dod.c:777)
==1002== by 0x4E901CE: trace_system_stack (cpu_dep.c:110)
==1002== by 0x4E9018F: trace_system_areas (cpu_dep.c:94)
==1002== by 0x4E71904: Parrot_dod_trace_root (dod.c:303)
==1002== by 0x4E7194A: trace_active_PMCs (dod.c:324)
==1002== by 0x4E72724: Parrot_dod_ms_run (dod.c:972)
==1002== by 0x4E72827: Parrot_do_dod_run (dod.c:1022)
==1002== by 0x4E708BB: more_traceable_objects (smallobject.c:101)
==1002== by 0x4E7095E: gc_ms_get_free_object (smallobject.c:146)
==1002== by 0x4E6E881: get_free_buffer (headers.c:48)
==1002==
==1002== Use of uninitialised value of size 8
==1002== at 0x4E715A4: pobject_lives (dod.c:145)
==1002== by 0x4E7232D: trace_mem_block (dod.c:781)
==1002== by 0x4E901CE: trace_system_stack (cpu_dep.c:110)
==1002== by 0x4E9018F: trace_system_areas (cpu_dep.c:94)
==1002== by 0x4E71904: Parrot_dod_trace_root (dod.c:303)
==1002== by 0x4E7194A: trace_active_PMCs (dod.c:324)
==1002== by 0x4E72724: Parrot_dod_ms_run (dod.c:972)
==1002== by 0x4E72827: Parrot_do_dod_run (dod.c:1022)
==1002== by 0x4E708BB: more_traceable_objects (smallobject.c:101)
==1002== by 0x4E7095E: gc_ms_get_free_object (smallobject.c:146)
==1002== by 0x4E6E881: get_free_buffer (headers.c:48)
==1002== by 0x4E6EEBC: new_string_header (headers.c:320)
==1002==
==1002== Conditional jump or move depends on uninitialised value(s)
==1002== at 0x4E70767: contained_in_pool (smallobject.c:54)
==1002== by 0x4E6F1C4: is_pmc_ptr (headers.c:482)
==1002== by 0x4E722E8: trace_mem_block (dod.c:770)
==1002== by 0x4E901CE: trace_system_stack (cpu_dep.c:110)
==1002== by 0x4E9018F: trace_system_areas (cpu_dep.c:94)
==1002== by 0x4E71904: Parrot_dod_trace_root (dod.c:303)
==1002== by 0x4E7194A: trace_active_PMCs (dod.c:324)
==1002== by 0x4E72724: Parrot_dod_ms_run (dod.c:972)
==1002== by 0x4E72827: Parrot_do_dod_run (dod.c:1022)
==1002== by 0x4E708BB: more_traceable_objects (smallobject.c:101)
==1002== by 0x4E7095E: gc_ms_get_free_object (smallobject.c:146)
==1002== by 0x4E6E881: get_free_buffer (headers.c:48)
==1002==
==1002== Conditional jump or move depends on uninitialised value(s)
==1002== at 0x4E70780: contained_in_pool (smallobject.c:54)
==1002== by 0x4E6F1C4: is_pmc_ptr (headers.c:482)
==1002== by 0x4E722E8: trace_mem_block (dod.c:770)
==1002== by 0x4E901CE: trace_system_stack (cpu_dep.c:110)
==1002== by 0x4E9018F: trace_system_areas (cpu_dep.c:94)
==1002== by 0x4E71904: Parrot_dod_trace_root (dod.c:303)
==1002== by 0x4E7194A: trace_active_PMCs (dod.c:324)
==1002== by 0x4E72724: Parrot_dod_ms_run (dod.c:972)
==1002== by 0x4E72827: Parrot_do_dod_run (dod.c:1022)
==1002== by 0x4E708BB: more_traceable_objects (smallobject.c:101)
==1002== by 0x4E7095E: gc_ms_get_free_object (smallobject.c:146)
==1002== by 0x4E6E881: get_free_buffer (headers.c:48)
==1002==
==1002== Conditional jump or move depends on uninitialised value(s)
==1002== at 0x4E707A4: contained_in_pool (smallobject.c:54)
==1002== by 0x4E6F1C4: is_pmc_ptr (headers.c:482)
==1002== by 0x4E722E8: trace_mem_block (dod.c:770)
==1002== by 0x4E901CE: trace_system_stack (cpu_dep.c:110)
==1002== by 0x4E9018F: trace_system_areas (cpu_dep.c:94)
==1002== by 0x4E71904: Parrot_dod_trace_root (dod.c:303)
==1002== by 0x4E7194A: trace_active_PMCs (dod.c:324)
==1002== by 0x4E72724: Parrot_dod_ms_run (dod.c:972)
==1002== by 0x4E72827: Parrot_do_dod_run (dod.c:1022)
==1002== by 0x4E708BB: more_traceable_objects (smallobject.c:101)
==1002== by 0x4E7095E: gc_ms_get_free_object (smallobject.c:146)
==1002== by 0x4E6E881: get_free_buffer (headers.c:48)
==1002==
==1002== Use of uninitialised value of size 8
==1002== at 0x4E715A4: pobject_lives (dod.c:145)
==1002== by 0x4E722F9: trace_mem_block (dod.c:775)
==1002== by 0x4E901CE: trace_system_stack (cpu_dep.c:110)
==1002== by 0x4E9018F: trace_system_areas (cpu_dep.c:94)
==1002== by 0x4E71904: Parrot_dod_trace_root (dod.c:303)
==1002== by 0x4E7194A: trace_active_PMCs (dod.c:324)
==1002== by 0x4E72724: Parrot_dod_ms_run (dod.c:972)
==1002== by 0x4E72827: Parrot_do_dod_run (dod.c:1022)
==1002== by 0x4E708BB: more_traceable_objects (smallobject.c:101)
==1002== by 0x4E7095E: gc_ms_get_free_object (smallobject.c:146)
==1002== by 0x4E6E881: get_free_buffer (headers.c:48)
==1002== by 0x4E6EEBC: new_string_header (headers.c:320)
1..1
==1002==
==1002== ERROR SUMMARY: 105 errors from 13 contexts (suppressed: 5
from 1)
==1002== malloc/free: in use at exit: 4,281,119 bytes in 3,132 blocks.
==1002== malloc/free: 15,102 allocs, 11,970 frees, 5,611,953 bytes
allocated.
==1002== For counts of detected errors, rerun with: -v
==1002== searching for pointers to 3,132 not-freed blocks.
==1002== checked 26,105,784 bytes.
==1002==
==1002== LEAK SUMMARY:
==1002== definitely lost: 10,981 bytes in 641 blocks.
==1002== possibly lost: 576 bytes in 2 blocks.
==1002== still reachable: 4,269,562 bytes in 2,489 blocks.
==1002== suppressed: 0 bytes in 0 blocks.
==1002== Use --leak-check=full to see details of leaked memory.
--
Andy Lester => [EMAIL PROTECTED] => www.petdance.com => AIM:petdance