From eec40eac8300a2edf346e61304da7988f4ac91cc Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 13 Jun 2014 13:50:13 +0000 Subject: [PATCH] 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 --- libgo/runtime/proc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libgo/runtime/proc.c b/libgo/runtime/proc.c index 1e1551989cb..d2130844717 100644 --- a/libgo/runtime/proc.c +++ b/libgo/runtime/proc.c @@ -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; }