]> Cypherpunks repositories - gostls13.git/commit
runtime/pprof: add context to short stack panic
authorMichael Pratt <mpratt@google.com>
Tue, 1 Oct 2024 17:12:39 +0000 (13:12 -0400)
committerGopher Robot <gobot@golang.org>
Tue, 1 Oct 2024 17:34:53 +0000 (17:34 +0000)
commit89228ca439b7ecfc4fa6641e79bb3119e600e519
tree6043e12400e7780983e4a1e6247a8f3accf8fa93
parent8194d735cff90871b1ea5c92e83ddd50abdd4185
runtime/pprof: add context to short stack panic

Over the years we've had various bugs in pprof stack handling resulting
in appendLocsForStack crashing because stk is too short for a cached
location. i.e., the cached location claims several inlined frames. Those
should always appear together in stk. If some frames are missing from
stk, appendLocsForStack.

If we find this case, replace the slice out of bounds panic with an
explicit panic that contains more context.

Change-Id: I52725a689baf42b8db627ce3e1bc6c654ef245d4
Reviewed-on: https://go-review.googlesource.com/c/go/+/617135
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/runtime/pprof/proto.go