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

Closed
gopherbot opened this issue Feb 28, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@gopherbot
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.

@gopherbot

This comment has been minimized.

Copy link
Author

commented Mar 1, 2019

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

@gopherbot

This comment has been minimized.

Copy link
Author

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
Reviewed-on: https://go-review.googlesource.com/c/164537
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
(cherry picked from commit 40df9cc)
Reviewed-on: https://go-review.googlesource.com/c/go/+/164627
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.