1
0
mirror of https://github.com/golang/go synced 2024-11-18 11:24:41 -07:00

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 <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Dmitry Vyukov 2016-09-24 16:59:23 +02:00
parent 893edc9b3f
commit c14050646f

View File

@ -1438,7 +1438,7 @@ func oneNewExtraM() {
gp.lockedm = mp gp.lockedm = mp
gp.goid = int64(atomic.Xadd64(&sched.goidgen, 1)) gp.goid = int64(atomic.Xadd64(&sched.goidgen, 1))
if raceenabled { if raceenabled {
gp.racectx = racegostart(funcPC(newextram)) gp.racectx = racegostart(funcPC(newextram) + sys.PCQuantum)
} }
// put on allg for garbage collector // put on allg for garbage collector
allgadd(gp) allgadd(gp)