From: Austin Clements Date: Thu, 11 May 2017 19:22:10 +0000 (-0400) Subject: runtime: print debug info on "base out of range" X-Git-Tag: go1.9beta1~268 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=29e88d513004749b6a84fc6ed32e026976ac1960;p=gostls13.git 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 --- diff --git a/src/runtime/mbitmap.go b/src/runtime/mbitmap.go index ef36fb8575..82bfe84267 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)