From b50b24837d34f78dc933027bcc6492df8b963b50 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Wed, 6 Jan 2016 14:02:50 -0500 Subject: [PATCH] runtime: don't ignore success of cgo profiling tracebacks If a sigprof happens during a cgo call, we traceback from the entry point of the cgo call. However, if the SP is outside of the G's stack, we'll then ignore this traceback, even if it was successful, and overwrite it with just _ExternalCode. Fix this by accepting any successful traceback, regardless of whether we got it from a cgo entry point or from regular Go code. Fixes #13466. Change-Id: I5da9684361fc5964f44985d74a8cdf02ffefd213 Reviewed-on: https://go-review.googlesource.com/18327 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- src/runtime/proc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/proc.go b/src/runtime/proc.go index fd8e161c17..c6f55fa035 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -3024,7 +3024,7 @@ func sigprof(pc, sp, lr uintptr, gp *g, mp *m) { } n = gentraceback(pc, sp, lr, gp, 0, &stk[0], len(stk), nil, nil, flags) } - if !traceback || n <= 0 { + if n <= 0 { // Normal traceback is impossible or has failed. // See if it falls into several common cases. n = 0