]> Cypherpunks repositories - gostls13.git/commit
runtime: clear frame pointer at thread entry points
authorNick Ripley <nick.ripley@datadoghq.com>
Mon, 17 Nov 2025 16:47:20 +0000 (11:47 -0500)
committerGopher Robot <gobot@golang.org>
Mon, 17 Nov 2025 20:06:42 +0000 (12:06 -0800)
commiteda2e8c683798e435e725f60f0bb580eb4aa9686
tree460989b26f694b04498d85b766c91fce77d81f88
parent6919858338ae3c4f244f65ca87e9e71662a83413
runtime: clear frame pointer at thread entry points

There are a few places in the runtime where new threads enter Go code
with a possibly invalid frame pointer. mstart is the entry point for new
Ms, and rt0_go is the entrypoint for the program. As we try to introduce
frame pointer unwinding in more places (e.g. for heap profiling in CL
540476 or for execution trace events on the system stack in CL 593835),
we see these functions on the stack. We need to ensure that they have
valid frame pointers. These functions are both considered the "top"
(first) frame frame of the call stack, so this CL sets the frame pointer
register to 0 in these functions.

Updates #63630

Change-Id: I6a6a6964a9ebc6f68ba23d2616e5fb6f19677f97
Reviewed-on: https://go-review.googlesource.com/c/go/+/721020
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
src/runtime/asm_amd64.s
src/runtime/asm_arm64.s