]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: print debug info on "base out of range"
authorAustin Clements <austin@google.com>
Thu, 11 May 2017 19:22:10 +0000 (15:22 -0400)
committerAustin Clements <austin@google.com>
Fri, 12 May 2017 14:28:15 +0000 (14:28 +0000)
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 <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/mbitmap.go

index ef36fb8575585fc8151df7575392a7ec3c5806d8..82bfe84267f91f6a03e2cafbbb27e17dd4045e8e 100644 (file)
@@ -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)