mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: restore caller's frame pointer when recovering from panic
When recovering from a panic, restore the caller's frame pointer before returning control to the caller. Otherwise, if the function proceeds to run more deferred calls before returning, the deferred functions will get invalid frame pointers pointing to an address lower in the stack. This can cause frame pointer unwinding to crash, such as if an execution trace event is recorded during the deferred call on architectures which support frame pointer unwinding. Fixes #61766 Change-Id: I45f41aedcc397133560164ab520ca638bbd93c4e Reviewed-on: https://go-review.googlesource.com/c/go/+/516157 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Felix Geisendörfer <felix.geisendoerfer@datadoghq.com>
This commit is contained in:
parent
94d36fbc4a
commit
b51a4dd6c4
3 changed files with 49 additions and 1 deletions
|
|
@ -1922,6 +1922,8 @@ func FPCallers(pcBuf []uintptr) int {
|
|||
return fpTracebackPCs(unsafe.Pointer(getfp()), pcBuf)
|
||||
}
|
||||
|
||||
const FramePointerEnabled = framepointer_enabled
|
||||
|
||||
var (
|
||||
IsPinned = isPinned
|
||||
GetPinCounter = pinnerGetPinCounter
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue