Skip to content

Commit 29e88d5

Browse files
committed
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Keith Randall <[email protected]>
1 parent dddd1dd commit 29e88d5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/runtime/mbitmap.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ func heapBitsForAddr(addr uintptr) heapBits {
364364
// heapBitsForSpan returns the heapBits for the span base address base.
365365
func heapBitsForSpan(base uintptr) (hbits heapBits) {
366366
if base < mheap_.arena_start || base >= mheap_.arena_used {
367+
print("runtime: base ", hex(base), " not in range [", hex(mheap_.arena_start), ",", hex(mheap_.arena_used), ")\n")
367368
throw("heapBitsForSpan: base out of range")
368369
}
369370
return heapBitsForAddr(base)

0 commit comments

Comments
 (0)