• Dmitry Vyukov's avatar
    runtime: fix out-of-bounds in stack debugging · 0c22a74e
    Dmitry Vyukov authored
    Currently stackDebug=4 crashes as:
    
    panic: runtime error: index out of range
    fatal error: panic on system stack
    runtime stack:
    runtime.throw(0x607470, 0x15)
    	src/runtime/panic.go:527 +0x96
    runtime.gopanic(0x5ada00, 0xc82000a1d0)
    	src/runtime/panic.go:354 +0xb9
    runtime.panicindex()
    	src/runtime/panic.go:12 +0x49
    runtime.adjustpointers(0xc820065ac8, 0x7ffe58b56100, 0x7ffe58b56318, 0x0)
    	src/runtime/stack1.go:428 +0x5fb
    runtime.adjustframe(0x7ffe58b56200, 0x7ffe58b56318, 0x1)
    	src/runtime/stack1.go:542 +0x780
    runtime.gentraceback(0x487760, 0xc820065ac0, 0x0, 0xc820001080, 0x0, 0x0, 0x7fffffff, 0x6341b8, 0x7ffe58b56318, 0x0, ...)
    	src/runtime/traceback.go:336 +0xa7e
    runtime.copystack(0xc820001080, 0x1000)
    	src/runtime/stack1.go:616 +0x3b1
    runtime.newstack()
    	src/runtime/stack1.go:801 +0xdde
    
    Change-Id: If2d60960231480a9dbe545d87385fe650d6db808
    Reviewed-on: https://go-review.googlesource.com/12763Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    0c22a74e
stack1.go 26.1 KB