Skip to content

Commit 6f6403e

Browse files
aclementsrsc
authored andcommitted
runtime: fix checkmarks to rescan stacks
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>
1 parent 0599913 commit 6f6403e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/runtime/mgc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,7 @@ func gc(mode int) {
937937
// Run a full stop-the-world mark using checkmark bits,
938938
// to check that we didn't forget to mark anything during
939939
// the concurrent mark process.
940+
gcResetGState() // Rescan stacks
940941
initCheckmarks()
941942
gcMark(startTime)
942943
clearCheckmarks()

0 commit comments

Comments
 (0)