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: mysterious crashes and non-determinism with range over func [1.23 backport] #69511

Closed
gopherbot opened this issue Sep 18, 2024 · 3 comments
Labels
CherryPickApproved Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime.
Milestone

Comments

@gopherbot
Copy link
Contributor

@ianlancetaylor requested issue #69507 to be considered for backport to the next 1.23 minor release.

@gopherbot Please open a backport to 1.23.

This appears to be a compiler bug related to the range-over-function code. The compiler is generating bad code--a variable that escapes is stack-allocated. There is no workaround (other than avoiding range-over-func).

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Sep 18, 2024
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Sep 18, 2024
@gopherbot gopherbot added this to the Go1.23.2 milestone Sep 18, 2024
@gopherbot
Copy link
Contributor Author

Change https://go.dev/cl/614195 mentions this issue: [release-branch.go1.23] cmd/compile: fix wrong esacpe analysis for rangefunc

@cagedmantis
Copy link
Contributor

This was approved last week. It is a serious issue without a workaround.

@cagedmantis cagedmantis added the CherryPickApproved Used during the release process for point releases label Sep 23, 2024
@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Sep 23, 2024
gopherbot pushed a commit that referenced this issue Sep 25, 2024
…ngefunc

CL 584596 "-range<N>" suffix to the name of closure generated for a
rangefunc loop body. However, this breaks the condition that escape
analysis uses for checking whether a closure contains within function,
which is "F.funcN" for outer function "F" and closure "funcN".

Fixing this by adding new "-rangeN" to the condition.

Updates #69434
Fixes #69511

Change-Id: I411de8f63b69a6514a9e9504d49d62e00ce4115d
Reviewed-on: https://go-review.googlesource.com/c/go/+/614096
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/614195
@gopherbot
Copy link
Contributor Author

Closed by merging CL 614195 (commit fbddfae) to release-branch.go1.23.

@mknyszek mknyszek changed the title runtime: mysterious crashes and non-determinism with range over func [1.23 backport] cmd/compile: mysterious crashes and non-determinism with range over func [1.23 backport] Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickApproved Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime.
Projects
None yet
Development

No branches or pull requests

2 participants