Skip to content

Commit

Permalink
Fix alt-stack handling in GC_push_all_stacks if stack grows up
Browse files Browse the repository at this point in the history
* pthread_stop_world.c [STACK_GROWS_UP] (GC_push_all_stacks): Set hi
to crtn->altstack (instead of crtn->altstack+crtn->altstack_size) if
lo is inside altstack; remove relevant FIXME item.
  • Loading branch information
ivmai committed May 19, 2023
1 parent ece931a commit 9229da0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pthread_stop_world.c
Original file line number Diff line number Diff line change
Expand Up @@ -859,9 +859,12 @@ GC_INNER void GC_push_all_stacks(void)
if (NULL == lo) ABORT("GC_push_all_stacks: sp not set!");
if (crtn -> altstack != NULL && (word)(crtn -> altstack) <= (word)lo
&& (word)lo <= (word)(crtn -> altstack) + crtn -> altstack_size) {
hi = crtn -> altstack + crtn -> altstack_size;
# ifdef STACK_GROWS_UP
hi = crtn -> altstack;
# else
hi = crtn -> altstack + crtn -> altstack_size;
# endif
/* FIXME: Need to scan the normal stack too, but how ? */
/* FIXME: Assume stack grows down */
}
GC_push_all_stack_sections(lo, hi, traced_stack_sect);
# ifdef STACK_GROWS_UP
Expand Down

0 comments on commit 9229da0

Please sign in to comment.