-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: fail to compile package in 1.24 #71680
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
Stack trace for the stuck state: stack-trace.log Culprit goroutine seems to be this:
|
Looks like it's somehow related to the recursive functions inside a closure, such as https://github.com/xiam/s-expr/blob/9d7e25c9d7d12b8b82f98b26ca28a52c97330acf/parser/parser.go#L122 By replacing all of them with a struct + method the problem went away. e.g.
|
cc @golang/compiler |
I bisected the issue to https://go-review.googlesource.com/c/go/+/630696 change. CC @dr2chase |
And here's a tiny repro: package repro
type Parser struct{}
type Node struct{}
type parserState func(p *Parser) parserState
func parserStateData(root *Node) parserState {
return func(p *Parser) parserState {
return parserStateOpenMap(root)(p)
}
}
func parserStateOpenMap(root *Node) parserState {
return func(p *Parser) parserState {
return parserStateData(root)(p)
}
} |
Thanks for the small repro. go/src/cmd/compile/internal/inline/inl.go Line 1043 in fc0049f
The names of the things in the inlining tree get really big really quickly, so I'm not surprised deeper names don't match the ones higher in the tree. @dr2chase Any ideas? I can keep poking if it isn't something obvious. |
Change https://go.dev/cl/649656 mentions this issue: |
Change https://go.dev/cl/649855 mentions this issue: |
It goes without saying but we should backport the fix to 1.24.1 right? |
@sluongng Seems likely. Let's agree on what the fix looks like first. |
@gopherbot please backport this to go1.24 release. This issue cause the compiler hangs for normal/existed users code. |
Backport issue(s) opened: #71829 (for 1.24). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
Go version
go1.24.0 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Tried to compile this specific package with Go 1.24 https://github.com/xiam/s-expr/tree/master/parser.
This is instrumented via Bazel's rules_go, but the failed command was
What did you see happen?
The compilation timeout in our CI setup.
Memory consumption of the sandbox keep increasing overtime.
What did you expect to see?
The package was able to compile normally on 1.23.6.
The text was updated successfully, but these errors were encountered: