On Thu, Nov 7, 2013 at 2:25 PM, Uros Bizjak <[email protected]> wrote:
>
> Recent Go mega-patch broke Alpha bootstrap. Following fixlet is needed:
>
> --cut here--
> Index: runtime/proc.c
> ===================================================================
> --- runtime/proc.c (revision 204522)
> +++ runtime/proc.c (working copy)
> @@ -2098,7 +2098,7 @@
> __splitstack_block_signals_context(&newg->stack_context[0],
> &dont_block_signals, nil);
> #else
> - *ret_stack = runtime_mallocgc(stacksize,
> FlagNoProfiling|FlagNoGC, 0, 0);
> + *ret_stack = runtime_mallocgc(stacksize, 0,
> FlagNoProfiling|FlagNoGC);
> *ret_stacksize = stacksize;
> newg->gcinitial_sp = *ret_stack;
> newg->gcstack_size = stacksize;
> --cut here--
>
> However, all runtime tests panic with:
>
> gmake[2]: *** [os/check] Error 1
> runtime: address space conflict: map(0xc000001000) = 0xc000002000
> fatal error: runtime: address space conflict
Thanks for the patch and report. This patch should fix them.
Bootstrapped and tested on x86_64-unknown-linux-gnu, not that that
proves much. Committed to mainline.
Ian
diff -r 9f650ddab115 libgo/runtime/mheap.c
--- a/libgo/runtime/mheap.c Wed Nov 06 11:23:33 2013 -0800
+++ b/libgo/runtime/mheap.c Thu Nov 07 15:34:54 2013 -0800
@@ -68,6 +68,7 @@
void
runtime_MHeap_MapSpans(MHeap *h)
{
+ uintptr pagesize;
uintptr n;
// Map spans array, PageSize at a time.
@@ -76,6 +77,8 @@
n -= (uintptr)h->arena_start;
n = n / PageSize * sizeof(h->spans[0]);
n = ROUND(n, PageSize);
+ pagesize = getpagesize();
+ n = ROUND(n, pagesize);
if(h->spans_mapped >= n)
return;
runtime_SysMap((byte*)h->spans + h->spans_mapped, n - h->spans_mapped, &mstats.other_sys);
diff -r 9f650ddab115 libgo/runtime/proc.c
--- a/libgo/runtime/proc.c Wed Nov 06 11:23:33 2013 -0800
+++ b/libgo/runtime/proc.c Thu Nov 07 15:34:54 2013 -0800
@@ -2098,7 +2098,7 @@
__splitstack_block_signals_context(&newg->stack_context[0],
&dont_block_signals, nil);
#else
- *ret_stack = runtime_mallocgc(stacksize, FlagNoProfiling|FlagNoGC, 0, 0);
+ *ret_stack = runtime_mallocgc(stacksize, 0, FlagNoProfiling|FlagNoGC);
*ret_stacksize = stacksize;
newg->gcinitial_sp = *ret_stack;
newg->gcstack_size = stacksize;