diff options
author | Keith Randall <khr@google.com> | 2019-09-16 14:38:12 -0700 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2019-09-23 16:50:00 +0000 |
commit | a14efb1be3a59dffbf4dd9121191d6d656049564 (patch) | |
tree | 495e090dede94f044caa36cd3169e76806772816 /src/runtime/symtab.go | |
parent | 870080752d175d5cede350486acf36213c64f35c (diff) | |
download | go-a14efb1be3a59dffbf4dd9121191d6d656049564.tar.gz go-a14efb1be3a59dffbf4dd9121191d6d656049564.zip |
runtime: allow the Go runtime to return multiple stack frames for a single PC
Upgrade the thread sanitizer to handle mid-stack inlining correctly.
We can now return multiple stack frames for each pc that the thread sanitizer
gives us to symbolize.
To fix #33309, we still need to modify the tsan library with its portion
of this fix, rebuild the .syso files on all supported archs, and check
them into runtime/race.
Update #33309
Change-Id: I340013631ffc8428043ab7efe3a41b6bf5638eaf
Reviewed-on: https://go-review.googlesource.com/c/go/+/195781
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Diffstat (limited to 'src/runtime/symtab.go')
-rw-r--r-- | src/runtime/symtab.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go index c2f32e0e5d..367e06003a 100644 --- a/src/runtime/symtab.go +++ b/src/runtime/symtab.go @@ -735,13 +735,15 @@ func funcname(f funcInfo) string { return gostringnocopy(cfuncname(f)) } -func funcnameFromNameoff(f funcInfo, nameoff int32) string { - datap := f.datap +func cfuncnameFromNameoff(f funcInfo, nameoff int32) *byte { if !f.valid() { - return "" + return nil } - cstr := &datap.pclntable[nameoff] - return gostringnocopy(cstr) + return &f.datap.pclntable[nameoff] +} + +func funcnameFromNameoff(f funcInfo, nameoff int32) string { + return gostringnocopy(cfuncnameFromNameoff(f, nameoff)) } func funcfile(f funcInfo, fileno int32) string { |