aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2017-05-11 15:22:10 -0400
committerChris Broadfoot <cbro@golang.org>2017-05-23 19:41:17 +0000
commitfb9770f09b99293a4aba55ec1d0fc6e6733b9e6e (patch)
tree824d898c4119b162db1993efeaa2f6c2414519f7
parentb6a8fc8d8cef50a62e6f5169054ae4c800481386 (diff)
downloadgo-fb9770f09b99293a4aba55ec1d0fc6e6733b9e6e.tar.gz
go-fb9770f09b99293a4aba55ec1d0fc6e6733b9e6e.zip
[release-branch.go1.8] runtime: print debug info on "base out of range"
Cherry-pick of CL 43310. 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/43410 Run-TryBot: Austin Clements <austin@google.com> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-rw-r--r--src/runtime/mbitmap.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/runtime/mbitmap.go b/src/runtime/mbitmap.go
index 89d8a4cc76..9b988fae25 100644
--- a/src/runtime/mbitmap.go
+++ b/src/runtime/mbitmap.go
@@ -374,6 +374,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)