Permalink
Browse files

[gc] Gix order-of-destruction bug discovered by Chandon++. The check …

…for aliveness of the scheduler in Parrot_cx_delete_taskwas failing, so in Scheduler.destroy I null out the ->scheduler field of the interpreter to ensure it gets around the segfault here. I don't think gc finalization adds PMCs back onto the free list, so the test there was failing

git-svn-id: https://svn.parrot.org/parrot/trunk@47560 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
1 parent 1c1cf15 commit 40787d49678b4e0a206232a4617528965d4a6617 @Whiteknight Whiteknight committed Jun 12, 2010
Showing with 2 additions and 1 deletion.
  1. +1 −0 src/pmc/scheduler.pmc
  2. +1 −1 src/scheduler.c
View
@@ -251,6 +251,7 @@ Frees the scheduler's underlying struct.
*/
VTABLE void destroy() {
Parrot_Scheduler_attributes * const core_struct = PARROT_SCHEDULER(SELF);
+ core_struct->interp->scheduler = NULL;
/* TT #946: this line is causing an order-of-destruction error
because the scheduler is being freed before its tasks.
Commenting this out till we get a real fix (although it's a hack) */
View
@@ -403,7 +403,7 @@ void
Parrot_cx_delete_task(PARROT_INTERP, ARGIN(PMC *task))
{
ASSERT_ARGS(Parrot_cx_delete_task)
- if (interp->scheduler && !PObj_on_free_list_TEST(interp->scheduler)) {
+ if (interp->scheduler) {
const INTVAL tid = VTABLE_get_integer(interp, task);
VTABLE_delete_keyed_int(interp, interp->scheduler, tid);
}

0 comments on commit 40787d4

Please sign in to comment.