From 29e88d513004749b6a84fc6ed32e026976ac1960 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Thu, 11 May 2017 15:22:10 -0400 Subject: [PATCH] runtime: print debug info on "base out of range" This adds debugging information when we panic with "heapBitsForSpan: base out of range". Updates #20259. Change-Id: I0dc1a106aa9e9531051c7d08867ace5ef230eb3f Reviewed-on: https://go-review.googlesource.com/43310 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/runtime/mbitmap.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/runtime/mbitmap.go b/src/runtime/mbitmap.go index ef36fb85755..82bfe84267f 100644 --- a/src/runtime/mbitmap.go +++ b/src/runtime/mbitmap.go @@ -364,6 +364,7 @@ func heapBitsForAddr(addr uintptr) heapBits { // heapBitsForSpan returns the heapBits for the span base address base. func heapBitsForSpan(base uintptr) (hbits heapBits) { if base < mheap_.arena_start || base >= mheap_.arena_used { + print("runtime: base ", hex(base), " not in range [", hex(mheap_.arena_start), ",", hex(mheap_.arena_used), ")\n") throw("heapBitsForSpan: base out of range") } return heapBitsForAddr(base)