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
(a cherry-pick of commit 9229da0 from 'master')

* pthread_stop_world.c [STACK_GROWS_UP] (GC_push_all_stacks): Set hi
to p->altstack (instead of p->altstack+p->altstack_size) if
lo is inside altstack; remove relevant FIXME item.
  • Loading branch information
ivmai committed May 20, 2023
1 parent 761414b commit f39ffd0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pthread_stop_world.c
Expand Up @@ -862,9 +862,12 @@ GC_INNER void GC_push_all_stacks(void)
if (0 == lo) ABORT("GC_push_all_stacks: sp not set!");
if (p->altstack != NULL && (word)p->altstack <= (word)lo
&& (word)lo <= (word)p->altstack + p->altstack_size) {
hi = p->altstack + p->altstack_size;
# ifdef STACK_GROWS_UP
hi = p->altstack;
# else
hi = p->altstack + p->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 f39ffd0

Please sign in to comment.