diff options
| author | Keith Randall <khr@golang.org> | 2018-03-14 15:21:37 -0700 |
|---|---|---|
| committer | Andrew Bonventre <andybons@golang.org> | 2018-03-29 06:09:45 +0000 |
| commit | ff5bff8a5fb4d81bf18f2cd23bfef30d5413e4e8 (patch) | |
| tree | ec655604b2c80401575dbb364213f69f6f38905b /src/runtime/stack.go | |
| parent | 76b63aaab90c0b8163c99598ef218451b5a82ec8 (diff) | |
| download | go-ff5bff8a5fb4d81bf18f2cd23bfef30d5413e4e8.tar.xz | |
[release-branch.go1.10] runtime: identify special functions by flag instead of address
When there are plugins, there may not be a unique copy of runtime
functions like goexit, mcall, etc. So identifying them by entry
address is problematic. Instead, keep track of each special function
using a field in the symbol table. That way, multiple copies of
the same runtime function will be treated identically.
Fixes #24351
Fixes #23133
Change-Id: Iea3232df8a6af68509769d9ca618f530cc0f84fd
Reviewed-on: https://go-review.googlesource.com/100739
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-on: https://go-review.googlesource.com/102793
Run-TryBot: Andrew Bonventre <andybons@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime/stack.go')
| -rw-r--r-- | src/runtime/stack.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/runtime/stack.go b/src/runtime/stack.go index 6149838b6d..1bfd9dd27f 100644 --- a/src/runtime/stack.go +++ b/src/runtime/stack.go @@ -619,7 +619,7 @@ func adjustframe(frame *stkframe, arg unsafe.Pointer) bool { if stackDebug >= 2 { print(" adjusting ", funcname(f), " frame=[", hex(frame.sp), ",", hex(frame.fp), "] pc=", hex(frame.pc), " continpc=", hex(frame.continpc), "\n") } - if f.entry == systemstack_switchPC { + if f.funcID == funcID_systemstack_switch { // A special routine at the bottom of stack of a goroutine that does an systemstack call. // We will allow it to be copied even though we don't // have full GC info for it (because it is written in asm). @@ -1110,7 +1110,8 @@ func shrinkstack(gp *g) { if debug.gcshrinkstackoff > 0 { return } - if gp.startpc == gcBgMarkWorkerPC { + f := findfunc(gp.startpc) + if f.valid() && f.funcID == funcID_gcBgMarkWorker { // We're not allowed to shrink the gcBgMarkWorker // stack (see gcBgMarkWorker for explanation). return |
