]> Cypherpunks repositories - gostls13.git/commit
runtime: check whether scavAddr is in inUse on scavengeOne fast path
authorMichael Anthony Knyszek <mknyszek@google.com>
Thu, 26 Dec 2019 19:49:39 +0000 (19:49 +0000)
committerMichael Knyszek <mknyszek@google.com>
Fri, 27 Dec 2019 14:52:12 +0000 (14:52 +0000)
commitdcd3b2c173b77d93be1c391e3b5f932e0779fb1f
tree321f009178270ab01a51d2d2d968147c6472ee6e
parent4f757179543e06daec58df6af5884516f8bceb86
runtime: check whether scavAddr is in inUse on scavengeOne fast path

This change makes it so that we check whether scavAddr is actually
mapped before trying to look at the summary for the fast path, since we
may segfault if that that part of the summary is not mapped in.
Previously this wasn't a problem because we would conservatively map
all memory for the summaries between the lowest mapped heap address and
the highest one.

This change also adds a test for this case.

Change-Id: I2b1d89b5e044dce81745964dfaba829f4becdc57
Reviewed-on: https://go-review.googlesource.com/c/go/+/212637
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/runtime/mgcscavenge.go
src/runtime/mgcscavenge_test.go
src/runtime/mranges.go