]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: do not treat mcall as a topofstack
authorRuss Cox <rsc@golang.org>
Thu, 28 Jan 2021 22:17:38 +0000 (17:17 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 19 Feb 2021 00:02:58 +0000 (00:02 +0000)
commit5ecd9e34dfe0491f1d76372e272d782578ad5bdb
tree404874e3495a40800778555bc77863b392fac779
parent54da3ab385686dec5554164ba9558214445deec9
runtime: do not treat mcall as a topofstack

I added mcall to this list in 2013 without explaining why.
(https://codereview.appspot.com/11085043/diff/61001/src/pkg/runtime/traceback_x86.c)
I suspect I was stopping crashes during profiling where the unwind
tried to walk up past mcall and got confused.

mcall is not something you can unwind past, because it switches
stacks, but it's also not something you should expect as a
standard top-of-stack frame. So if you do see it during say
a garbage collection stack walk, it would be important to crash
instead of silently stopping the walk prematurely.

This CL removes it from the topofstack list to avoid the silent stop.
Now that mcall is detected as SPWRITE, that will stop the
unwind (with a crash if encountered during GC, which we want).

This CL is part of a stack adding windows/arm64
support (#36439), intended to land in the Go 1.17 cycle.
This CL is, however, not windows/arm64-specific.
It is cleanup meant to make the port (and future ports) easier.

Change-Id: I666487ce24efd72292f2bc3eac7fe0477e16bddd
Reviewed-on: https://go-review.googlesource.com/c/go/+/288803
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/runtime/symtab.go
src/runtime/traceback.go