]> Cypherpunks repositories - gostls13.git/commit
runtime: add note that Callers never returns an entry PC
authorMichael Pratt <mpratt@google.com>
Fri, 6 Dec 2024 20:37:34 +0000 (15:37 -0500)
committerGopher Robot <gobot@golang.org>
Fri, 6 Dec 2024 21:15:30 +0000 (21:15 +0000)
commit312f7c1bd300d374f7078c4449c5ad142e0c3a5e
treecd612a51ad35fa224b17273e4952e74948da6261
parent0d453232db9c4eeea5faa7dd171b95a59619f160
runtime: add note that Callers never returns an entry PC

The presence of a pc > entry check in CallersFrame implies we might
actually see pc == entry, when in reality Callers will never return such
a PC. This check is actually just a safety check for avoid reporting
completely nonsensical from bad input.

all.bash reports two violations to this invariant:

TestCallersFromWrapper, which explicitly constructs a CallersFrame input
with an entry PC.

runtime/pprof.printStackRecord, which passes pprof stacks to
CallersFrame (technically not a valid use of CallersFrames!).
runtime/pprof.(*Profile).Add can add the entry PC of
runtime/pprof.lostProfileEvent to samples.

(CPU profiles do lostProfileEvent + 1. I will send a second CL to fix
Add.)

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