re PR go/61498 (Many 64-bit Go tests SEGV in scanblock)

PR go/61498
runtime: Always set gcnext_sp to pointer-aligned address.

The gcnext_sp field is only used on systems that do not use
split stacks.  It marks the bottom of the stack for the
garbage collector.  This change makes sure that the stack
bottom is always aligned to a pointer value.

Previously the garbage collector would align all the addresses
that it scanned, but it now expects them to be aligned before
scanning.

From-SVN: r211639
This commit is contained in:
Ian Lance Taylor 2014-06-13 13:50:13 +00:00
parent f6c438246c
commit eec40eac83

View File

@ -255,9 +255,6 @@ runtime_mcall(void (*pfn)(G*))
{
M *mp;
G *gp;
#ifndef USING_SPLIT_STACK
int i;
#endif
// Ensure that all registers are on the stack for the garbage
// collector.
@ -273,7 +270,7 @@ runtime_mcall(void (*pfn)(G*))
#ifdef USING_SPLIT_STACK
__splitstack_getcontext(&g->stack_context[0]);
#else
gp->gcnext_sp = &i;
gp->gcnext_sp = &pfn;
#endif
gp->fromgogo = false;
getcontext(&gp->context);
@ -1933,7 +1930,7 @@ doentersyscall()
&g->gcinitial_sp);
#else
{
uint32 v;
void *v;
g->gcnext_sp = (byte *) &v;
}