Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: KeepAlive doesn't actually keep stack object alive [1.12 backport] #30478

gopherbot opened this issue Feb 28, 2019 · 2 comments


None yet
2 participants
Copy link

commented Feb 28, 2019

@bcmills requested issue #30476 to be considered for backport to the next 1.12 minor release.

@gopherbot, please backport to Go 1.12: this is a regression in a core runtime behavior.


This comment has been minimized.

Copy link

commented Mar 1, 2019

Change mentions this issue: [release-branch.go1.12] cmd/compile: make KeepAlive work on stack object


This comment has been minimized.

Copy link

commented Mar 13, 2019

Closed by merging 6fc1242 to release-branch.go1.12.

@gopherbot gopherbot closed this Mar 13, 2019

gopherbot pushed a commit that referenced this issue Mar 13, 2019

[release-branch.go1.12] cmd/compile: make KeepAlive work on stack object
Currently, runtime.KeepAlive applied on a stack object doesn't
actually keeps the stack object alive, and the heap object
referenced from it could be collected. This is because the
address of the stack object is rematerializeable, and we just
ignored KeepAlive on rematerializeable values. This CL fixes it.

Updates #30476.
Fixes #30478.

Change-Id: Ic1f75ee54ed94ea79bd46a8ddcd9e81d01556d1d
Run-TryBot: Cherry Zhang <>
TryBot-Result: Gobot Gobot <>
Reviewed-by: Keith Randall <>
(cherry picked from commit 40df9cc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.