]> Cypherpunks repositories - gostls13.git/commit
runtime: debug code to catch bad gcWork.puts
authorAustin Clements <austin@google.com>
Mon, 19 Nov 2018 15:37:14 +0000 (10:37 -0500)
committerAustin Clements <austin@google.com>
Wed, 21 Nov 2018 16:28:17 +0000 (16:28 +0000)
commit9098d1d85494810a21c6342c8f501dae8fc757d6
treeb045b38d7b9c8a104683338b988edcf055fd37a1
parentb8fad4b33d20224f2965a1e9cdbd931fda0ed636
runtime: debug code to catch bad gcWork.puts

This adds a debug check to throw immediately if any pointers are added
to the gcWork buffer after the mark completion barrier. The intent is
to catch the source of the cached GC work that occasionally produces
"P has cached GC work at end of mark termination" failures.

The result should be that we get "throwOnGCWork" throws instead of "P
has cached GC work at end of mark termination" throws, but with useful
stack traces.

This should be reverted before the release. I've been unable to
reproduce this issue locally, but this issue appears fairly regularly
on the builders, so the intent is to catch it on the builders.

This probably slows down the GC slightly.

For #27993.

Change-Id: I5035e14058ad313bfbd3d68c41ec05179147a85c
Reviewed-on: https://go-review.googlesource.com/c/149969
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/inl_test.go
src/runtime/mgc.go
src/runtime/mgcwork.go