]> Cypherpunks repositories - gostls13.git/commit
runtime: mark gcWork methods nowritebarrierrec
authorAustin Clements <austin@google.com>
Thu, 19 Oct 2017 23:57:46 +0000 (19:57 -0400)
committerAustin Clements <austin@google.com>
Sun, 29 Oct 2017 17:56:12 +0000 (17:56 +0000)
commit249b5cc9452534d677499c7017b1081533ba56fe
tree639f246a7ee9c2343af8244714669c4741e4f00c
parent3beaf26e4fbf1bfd166fc3b5b7584a58b11e726c
runtime: mark gcWork methods nowritebarrierrec

Currently most of these are marked go:nowritebarrier as a hint, but
it's actually important that these not invoke write barriers
recursively. The danger is that some gcWork method would invoke the
write barrier while the gcWork is in an inconsistent state and that
the write barrier would in turn invoke some other gcWork method, which
would crash or permanently corrupt the gcWork. Simply marking the
write barrier itself as go:nowritebarrierrec isn't sufficient to
prevent this if the write barrier doesn't use the outer method.

Thankfully, this doesn't cause any build failures, so we were getting
this right. :)

For #22460.

Change-Id: I35a7292a584200eb35a49507cd3fe359ba2206f6
Reviewed-on: https://go-review.googlesource.com/72554
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
src/runtime/mgcwork.go