On Mon, 2005-03-28 at 11:42 +0200, Leopold Toetsch wrote: > > (gdb) bt > > #0 0x100b74f0 in pobject_lives (interpreter=0x103ac910, obj=0x35) > > at src/dod.c:196 > > #1 0x10278d7c in Parrot_SArray_mark (interpreter=0x103ac910, > > pmc=0x1056c540) > > at classes/sarray.c:276 > > At that point we have AFAIK two SArrays around: the @ARGV array, which > should be visible in REG_PMC(5) and the interpreter->iglobals array, > see src/global_setup.c. > > Could you please check, which of these two PMCs is marked and at what > index of the array the bogus object is marked.
I've attached a patch representing the code I added for debugging, being at a loss for how to do this from gdb. Here's the output: ./parrot config_lib.pasm Marking 274122152 Iglobals: 274122152 ARGV: 274116056 Checking index 0 make: *** [runtime/parrot/include/config.fpmc] Segmentation fault It looks like the first element of interpreter->iglobals is wrong. I set a breakpoint at the print and did a bit of data dumping: Breakpoint 1, Parrot_SArray_mark (interpreter=0x103ac978, pmc=0x1056c5a8) at classes/sarray.c:269 269 printf( "Checking index %d\n", i ); (gdb) x e 0x10576a98: 0xffffff9f (gdb) p e $1 = (HashEntry *) 0x10576a98 (gdb) p e->type $2 = enum_hash_pmc (gdb) p e->val $3 = {_b = {_bufstart = 0x0, _buflen = 53}, _ptrs = {_struct_val = 0x0, _pmc_val = 0x35}, _i = {_int_val = 0, _int_val2 = 53}, _num_val = 2.6185479229586067e-322, _string_val = 0x0} Is that null _struct_val the problem? -- c
Index: src/dod.c =================================================================== RCS file: /cvs/public/parrot/src/dod.c,v retrieving revision 1.146 diff -u -u -r1.146 dod.c --- src/dod.c 14 Mar 2005 14:45:40 -0000 1.146 +++ src/dod.c 29 Mar 2005 01:35:16 -0000 @@ -457,6 +457,9 @@ } else { /* All that's left is the custom */ + printf( "Marking %d\n", current ); + printf( "Iglobals: %d\n", interpreter->iglobals ); + printf( "ARGV: %d\n", REG_PMC(5) ); VTABLE_mark(interpreter, current); } } Index: classes/sarray.pmc =================================================================== RCS file: /cvs/public/parrot/classes/sarray.pmc,v retrieving revision 1.33 diff -u -u -r1.33 sarray.pmc --- classes/sarray.pmc 12 Jan 2005 11:42:06 -0000 1.33 +++ classes/sarray.pmc 29 Mar 2005 01:36:31 -0000 @@ -277,6 +277,7 @@ end = UVal_int(e[1].val); e = (HashEntry *) PMC_data(SELF) + (2 + start); for (i = start; i < end; i++, e++) { + printf( "Checking index %d\n", i ); switch (e->type) { case enum_hash_string: if (UVal_str(e->val))