Skip to content

Commit 822dbcb

Browse files
committed
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 <[email protected]> Trust: Michael Pratt <[email protected]> Run-TryBot: Michael Pratt <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 38cf795 commit 822dbcb

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/runtime/proc.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4671,7 +4671,6 @@ func sigprof(pc, sp, lr uintptr, gp *g, mp *m) {
46714671
getg().m.mallocing++
46724672

46734673
var stk [maxCPUProfStack]uintptr
4674-
flags := uint(_TraceJumpStack)
46754674
n := 0
46764675
if mp.ncgo > 0 && mp.curg != nil && mp.curg.syscallpc != 0 && mp.curg.syscallsp != 0 {
46774676
cgoOff := 0
@@ -4689,12 +4688,12 @@ func sigprof(pc, sp, lr uintptr, gp *g, mp *m) {
46894688
}
46904689

46914690
// Collect Go stack that leads to the cgo call.
4692-
n = gentraceback(mp.curg.syscallpc, mp.curg.syscallsp, 0, mp.curg, 0, &stk[cgoOff], len(stk)-cgoOff, nil, nil, flags)
4691+
n = gentraceback(mp.curg.syscallpc, mp.curg.syscallsp, 0, mp.curg, 0, &stk[cgoOff], len(stk)-cgoOff, nil, nil, 0)
46934692
if n > 0 {
46944693
n += cgoOff
46954694
}
46964695
} else {
4697-
n = gentraceback(pc, sp, lr, gp, 0, &stk[0], len(stk), nil, nil, _TraceTrap|flags)
4696+
n = gentraceback(pc, sp, lr, gp, 0, &stk[0], len(stk), nil, nil, _TraceTrap|_TraceJumpStack)
46984697
}
46994698

47004699
if n <= 0 {
@@ -4704,10 +4703,10 @@ func sigprof(pc, sp, lr uintptr, gp *g, mp *m) {
47044703
if usesLibcall() && mp.libcallg != 0 && mp.libcallpc != 0 && mp.libcallsp != 0 {
47054704
// Libcall, i.e. runtime syscall on windows.
47064705
// Collect Go stack that leads to the call.
4707-
n = gentraceback(mp.libcallpc, mp.libcallsp, 0, mp.libcallg.ptr(), 0, &stk[0], len(stk), nil, nil, flags)
4706+
n = gentraceback(mp.libcallpc, mp.libcallsp, 0, mp.libcallg.ptr(), 0, &stk[0], len(stk), nil, nil, 0)
47084707
}
47094708
if n == 0 && mp != nil && mp.vdsoSP != 0 {
4710-
n = gentraceback(mp.vdsoPC, mp.vdsoSP, 0, gp, 0, &stk[0], len(stk), nil, nil, flags)
4709+
n = gentraceback(mp.vdsoPC, mp.vdsoSP, 0, gp, 0, &stk[0], len(stk), nil, nil, _TraceTrap|_TraceJumpStack)
47114710
}
47124711
if n == 0 {
47134712
// If all of the above has failed, account it against abstract "System" or "GC".

0 commit comments

Comments
 (0)