aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/proc.go
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2022-01-31 17:10:58 -0500
committerMichael Pratt <mpratt@google.com>2022-01-31 22:38:49 +0000
commit822dbcb7d4b7ab2410bdc19355a0bff99c3c467e (patch)
tree3e0afbd9d7783f6ed6c8c91a09146f131c419244 /src/runtime/proc.go
parent38cf79526a5859fb6363e607b2277ab442b28dcb (diff)
downloadgo-822dbcb7d4b7ab2410bdc19355a0bff99c3c467e.tar.gz
go-822dbcb7d4b7ab2410bdc19355a0bff99c3c467e.zip
Revert "runtime: normalize sigprof traceback flags"
This reverts commit CL 358900. Adding _TraceJumpStack to cgo traceback exposed a crashing condition. This CL was primarily a cleanup, so we revert it entirely for now and follow-up with the VDSO and libcall parts later. Fixes #50936. Change-Id: Ie45c9caaa8e2ef5bc9498ba65c36c887ca821bf7 Reviewed-on: https://go-review.googlesource.com/c/go/+/382079 Reviewed-by: Cherry Mui <cherryyz@google.com> Trust: Michael Pratt <mpratt@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/runtime/proc.go')
-rw-r--r--src/runtime/proc.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index eee0a25fee..1be7a60830 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -4671,7 +4671,6 @@ func sigprof(pc, sp, lr uintptr, gp *g, mp *m) {
getg().m.mallocing++
var stk [maxCPUProfStack]uintptr
- flags := uint(_TraceJumpStack)
n := 0
if mp.ncgo > 0 && mp.curg != nil && mp.curg.syscallpc != 0 && mp.curg.syscallsp != 0 {
cgoOff := 0
@@ -4689,12 +4688,12 @@ func sigprof(pc, sp, lr uintptr, gp *g, mp *m) {
}
// Collect Go stack that leads to the cgo call.
- n = gentraceback(mp.curg.syscallpc, mp.curg.syscallsp, 0, mp.curg, 0, &stk[cgoOff], len(stk)-cgoOff, nil, nil, flags)
+ n = gentraceback(mp.curg.syscallpc, mp.curg.syscallsp, 0, mp.curg, 0, &stk[cgoOff], len(stk)-cgoOff, nil, nil, 0)
if n > 0 {
n += cgoOff
}
} else {
- n = gentraceback(pc, sp, lr, gp, 0, &stk[0], len(stk), nil, nil, _TraceTrap|flags)
+ n = gentraceback(pc, sp, lr, gp, 0, &stk[0], len(stk), nil, nil, _TraceTrap|_TraceJumpStack)
}
if n <= 0 {
@@ -4704,10 +4703,10 @@ func sigprof(pc, sp, lr uintptr, gp *g, mp *m) {
if usesLibcall() && mp.libcallg != 0 && mp.libcallpc != 0 && mp.libcallsp != 0 {
// Libcall, i.e. runtime syscall on windows.
// Collect Go stack that leads to the call.
- n = gentraceback(mp.libcallpc, mp.libcallsp, 0, mp.libcallg.ptr(), 0, &stk[0], len(stk), nil, nil, flags)
+ n = gentraceback(mp.libcallpc, mp.libcallsp, 0, mp.libcallg.ptr(), 0, &stk[0], len(stk), nil, nil, 0)
}
if n == 0 && mp != nil && mp.vdsoSP != 0 {
- n = gentraceback(mp.vdsoPC, mp.vdsoSP, 0, gp, 0, &stk[0], len(stk), nil, nil, flags)
+ n = gentraceback(mp.vdsoPC, mp.vdsoSP, 0, gp, 0, &stk[0], len(stk), nil, nil, _TraceTrap|_TraceJumpStack)
}
if n == 0 {
// If all of the above has failed, account it against abstract "System" or "GC".