-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: finalizer call has wrong frame size #51457
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
Comments
@gopherbot please backport this to Go 1.17 release. Thanks. |
Change https://go.dev/cl/388995 mentions this issue: |
Backport issue(s) opened: #51458 (for 1.17). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
Change https://go.dev/cl/389794 mentions this issue: |
Closed by merging ce427cf to release-branch.go1.18. |
…inalizer call The finalizer is called using reflectcall. When register ABI is used, the finalizer's argument is passed in register(s). But the frame size calculation does not include the spill slot. When the argument actually spills, it may clobber the caller's stack frame. This CL fixes it. Fixes #51457. Change-Id: Ibcc7507c518ba65c1c5a7759e5cab0ae3fc7efce Reviewed-on: https://go-review.googlesource.com/c/go/+/389574 Trust: Cherry Mui <[email protected]> Run-TryBot: Cherry Mui <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Michael Knyszek <[email protected]> (cherry picked from commit 58804ea) Reviewed-on: https://go-review.googlesource.com/c/go/+/388995 Trust: Dmitri Shuralyov <[email protected]> Run-TryBot: Dmitri Shuralyov <[email protected]>
…inalizer call The finalizer is called using reflectcall. When register ABI is used, the finalizer's argument is passed in register(s). But the frame size calculation does not include the spill slot. When the argument actually spills, it may clobber the caller's stack frame. This CL fixes it. Updates #51457. Fixes #51458. Change-Id: Ibcc7507c518ba65c1c5a7759e5cab0ae3fc7efce Reviewed-on: https://go-review.googlesource.com/c/go/+/389574 Trust: Cherry Mui <[email protected]> Run-TryBot: Cherry Mui <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Michael Knyszek <[email protected]> (cherry picked from commit 58804ea) Reviewed-on: https://go-review.googlesource.com/c/go/+/389794
What version of Go are you using (
go version
)?tip (bcb89fc)
Does this issue reproduce with the latest release?
Yes. Reproduce with Go 1.17 and tip, not with Go 1.16.
What operating system and processor architecture are you using (
go env
)?darwin/amd64
What did you do?
This program runs fine with Go 1.16, but crash with Go 1.17 and tip. It is due to finalizer call has wrong frame size on register-ABI platforms, which leads to memory corruption.
Fixed by CL https://go-review.googlesource.com/c/go/+/389574 .
Open an issue for Go 1.18.
The text was updated successfully, but these errors were encountered: