]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix checkmarks to rescan stacks
authorAustin Clements <austin@google.com>
Fri, 5 Jun 2015 21:36:00 +0000 (17:36 -0400)
committerRuss Cox <rsc@golang.org>
Sun, 7 Jun 2015 17:55:12 +0000 (17:55 +0000)
Currently checkmarks mode fails to rescan stacks because it sees the
leftover state bits indicating that the stacks haven't changed since
the last scan. As a result, it won't detect lost marks caused by
failing to scan stacks correctly during regular garbage collection.

Fix this by marking all stacks dirty before performing the checkmark
phase.

Change-Id: I1f06882bb8b20257120a4b8e7f95bb3ffc263895
Reviewed-on: https://go-review.googlesource.com/10794
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/mgc.go

index 71b083b29cca2bd6c22e7f0dee4cc594eadb6668..baad5b66938df129b9d6d2a68f9fb794c716eb44 100644 (file)
@@ -937,6 +937,7 @@ func gc(mode int) {
                        // Run a full stop-the-world mark using checkmark bits,
                        // to check that we didn't forget to mark anything during
                        // the concurrent mark process.
+                       gcResetGState() // Rescan stacks
                        initCheckmarks()
                        gcMark(startTime)
                        clearCheckmarks()