From d30221dac7b32de5478ea0466d81ecc9ee1c2648 Mon Sep 17 00:00:00 2001 From: aarzilli Date: Fri, 2 Oct 2015 13:09:41 +0200 Subject: [PATCH] proc/variables: chanRecvReturnAddress uses outdated frame info g.SP refers to the frame the goroutine was in the last time it was scheduled out. Instead of calling proc.(*Process).stacktrace directly we should call proc.(*Process).GoroutineStacktrace that substitutes fresh values retrieved from thread registers when necessary. This bug leads to occasional problems with `next`. --- proc/variables.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proc/variables.go b/proc/variables.go index 6b99de75..0772d6e2 100644 --- a/proc/variables.go +++ b/proc/variables.go @@ -152,7 +152,7 @@ func (g *G) ChanRecvBlocked() bool { // chanRecvReturnAddr returns the address of the return from a channel read. func (g *G) chanRecvReturnAddr(dbp *Process) (uint64, error) { - locs, err := dbp.stacktrace(g.PC, g.SP, 4) + locs, err := dbp.GoroutineStacktrace(g, 4) if err != nil { return 0, err }