]> Cypherpunks repositories - gostls13.git/commit
runtime: fix checkmark scanning of finalizers
authorAustin Clements <austin@google.com>
Mon, 7 Mar 2016 22:10:19 +0000 (17:10 -0500)
committerAustin Clements <austin@google.com>
Mon, 7 Mar 2016 22:32:20 +0000 (22:32 +0000)
commit2b19b6e3f109a7a7392d4628ae700833623aa26e
tree2c19b954f71c0ba8835fa2382aac18c16cbf7d60
parentb4c66b176e4ae155565c6e9ad07041540081c792
runtime: fix checkmark scanning of finalizers

Currently work.finalizersDone is reset only at the beginning of
gcStart. As a result, it will be set when checkmark runs, so checkmark
will skip scanning finalizers. Hence, if there are any bugs that cause
the regular scan of finalizers to miss pointers, checkmark will also
miss them and fail to detect the missed pointer.

Fix this by resetting finalizersDone in gcResetMarkState. This way it
gets reset before any full mark, which is exactly what we want.

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