The attached patch disables GC at startup. If you turn on GC_DEBUG, you'll see parrot crash at startup because dod runs and collection runs are being performed before the interpreter is fully initialized, causing all sorts of havoc.
This also means that if our default GC allocation values do not provide enough room to completely start up Parrot, we'll die. Of course, this still would happen prior to this patch...this only causes the allocate_buffer routines to detect that they didn't have enough memory, instead of causing it to perform dod and collection runs on uninitialized data. There are still plenty of problems with GC_DEBUG turned on, but at least it passes all the non-pmc tests now. Has anyone done anything with attempting to get a make tinder and tindertest set up? Mike Lambert
? changes.txt Index: interpreter.c =================================================================== RCS file: /cvs/public/parrot/interpreter.c,v retrieving revision 1.82 diff -u -r1.82 interpreter.c --- interpreter.c 2 Apr 2002 06:24:14 -0000 1.82 +++ interpreter.c 11 Apr 2002 21:16:59 -0000 @@ -497,6 +497,9 @@ interpreter->DOD_block_level = 0; interpreter->GC_block_level = 0; + interpreter->flags = flags; + Interp_flags_CLEAR(interpreter,PARROT_ALLOW_GC_FLAG); + /* Set up the memory allocation system */ mem_setup_allocator(interpreter); @@ -506,8 +509,7 @@ pmc_new(interpreter, enum_class_PerlHash); interpreter->perl_stash->parent_stash = NULL; - /* Initialize interpreter's flags */ - interpreter->flags = flags; + /* Initialize interpreter warnings */ interpreter->warns = mem_sys_allocate(sizeof(struct warnings_t)); memset(interpreter->warns, 0, sizeof(struct warnings_t)); PARROT_WARNINGS_off(interpreter, PARROT_WARNINGS_ALL_FLAG); @@ -557,6 +559,9 @@ interpreter->pmc_reg_base->next = NULL; interpreter->pmc_reg_base->prev = NULL; Parrot_clear_p(interpreter); + + /* We've got enough for full interpreter now, so allow gc */ + Interp_flags_SET(interpreter,PARROT_ALLOW_GC_FLAG); /* Need a user stack */ interpreter->user_stack = new_stack(interpreter); Index: resources.c =================================================================== RCS file: /cvs/public/parrot/resources.c,v retrieving revision 1.41 diff -u -r1.41 resources.c --- resources.c 11 Apr 2002 18:54:33 -0000 1.41 +++ resources.c 11 Apr 2002 21:17:00 -0000 @@ -565,6 +565,11 @@ void Parrot_do_dod_run(struct Parrot_Interp *interpreter) { + /* Exit early if we shouldn't be running */ + if(!Interp_flags_TEST(interpreter,PARROT_ALLOW_GC_FLAG)) { + return; + } + /* First go mark all PMCs as unused */ mark_PMCs_unused(interpreter); @@ -707,6 +712,11 @@ char *cur_spot; /* Where we're currently copying to */ UINTVAL cur_size; /* How big our chunk is going to be */ struct STRING_Arena *cur_arena; /* The string arena we're working on */ + + /* Exit early if we shouldn't be running */ + if(!Interp_flags_TEST(interpreter,PARROT_ALLOW_GC_FLAG)) { + return; + } /* We're collecting */ interpreter->mem_allocs_since_last_collect = 0; Index: include/parrot/interpreter.h =================================================================== RCS file: /cvs/public/parrot/include/parrot/interpreter.h,v retrieving revision 1.40 diff -u -r1.40 interpreter.h --- include/parrot/interpreter.h 3 Apr 2002 04:01:41 -0000 1.40 +++ include/parrot/interpreter.h 11 Apr 2002 21:17:02 -0000 @@ -23,7 +23,8 @@ PARROT_BOUNDS_FLAG = 0x04, /* We're tracking byte code bounds */ PARROT_PROFILE_FLAG = 0x08, /* We're gathering profile information */ PARROT_PREDEREF_FLAG = 0x10, /* We're using the prederef runops */ - PARROT_JIT_FLAG = 0x20 /* We're using the jit runops */ + PARROT_JIT_FLAG = 0x20, /* We're using the jit runops */ + PARROT_ALLOW_GC_FLAG = 0x40 /* Allow dod and collection to occur */ } Interp_flags; #define Interp_flags_SET(interp, flag) (/*@i1@*/ (interp)->flags |= (flag))