]> Cypherpunks repositories - gostls13.git/commit
runtime: fix liveness issue in test-only getgcmask
authorMichael Anthony Knyszek <mknyszek@google.com>
Wed, 15 Nov 2023 21:54:45 +0000 (21:54 +0000)
committerMichael Knyszek <mknyszek@google.com>
Thu, 16 Nov 2023 05:48:17 +0000 (05:48 +0000)
commit17eb0a2bac79eda8dc71d628474989d05d9755c5
tree12138930b91eb1100ec6075b4f5dd340d17a0f89
parent0011342590391655bd0cd732cf89c385c30c1278
runtime: fix liveness issue in test-only getgcmask

getgcmask stops referencing the object passed to it sometime between
when the object is looked up and when the function returns. Notably,
this can happen while the GC mask is actively being produced, and thus
the GC might free the object.

This is easily reproducible by adding a runtime.GC call at just the
right place. Adding a KeepAlive on the heap-object path fixes it.

Fixes #64188.

Change-Id: I5ed4cae862fc780338b60d969fd7fbe896352ce4
Reviewed-on: https://go-review.googlesource.com/c/go/+/542716
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/runtime/mbitmap_allocheaders.go
src/runtime/mbitmap_noallocheaders.go