Skip to content

Commit

Permalink
[gc] Gix order-of-destruction bug discovered by Chandon++. The check …
Browse files Browse the repository at this point in the history
…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
Whiteknight committed Jun 12, 2010
1 parent 1c1cf15 commit 40787d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/pmc/scheduler.pmc
Expand Up @@ -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) */
Expand Down
2 changes: 1 addition & 1 deletion src/scheduler.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit 40787d4

Please sign in to comment.