From: Dmitry Vyukov Date: Sat, 24 Sep 2016 14:59:23 +0000 (+0200) Subject: runtime: fix newextram PC passed to race detector X-Git-Tag: go1.8beta1~1176 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c14050646f621db5f54c1a300b80c65f99fbd03b;p=gostls13.git runtime: fix newextram PC passed to race detector PC passed to racegostart is expected to be a return PC of the go statement. Race runtime will subtract 1 from the PC before symbolization. Passing start PC of a function is wrong. Add sys.PCQuantum to the function start PC. Update #17190 Change-Id: Ia504c49e79af84ed4ea360c2aea472b370ea8bf5 Reviewed-on: https://go-review.googlesource.com/29712 Run-TryBot: Dmitry Vyukov TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/runtime/proc.go b/src/runtime/proc.go index 4dd2bd2005..2c50fb5afe 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -1438,7 +1438,7 @@ func oneNewExtraM() { gp.lockedm = mp gp.goid = int64(atomic.Xadd64(&sched.goidgen, 1)) if raceenabled { - gp.racectx = racegostart(funcPC(newextram)) + gp.racectx = racegostart(funcPC(newextram) + sys.PCQuantum) } // put on allg for garbage collector allgadd(gp)