You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cmd/compile: Go 1.22 build fails with 1.21 PGO profile on internal/saferio change #65615
We are continuously collecting PGO profiles and apply them to new builds, a process that worked seamlessly with Go 1.21. I upgraded to Go 1.22 and attempted to compile our build using the Go 1.21 PGO profile.
go build -pgo=auto .
What did you see happen?
The go build command failed, producing the following error:
go build -pgo=auto .
# encoding/gob
/usr/lib/go/src/bufio/bufio.go:47:6: internal compiler error: saferio.SliceCap has 0+1 params, but instantiated with 0+0 args
This error suggests a change made to the SliceCap method in the internal/saferio package between Go 1.21 and Go 1.22:
I assume this isn't expected because according to the PGO documentation a change to the source code could result in performance degradation but not necessarily compilation failure.
Thanks for filing this! We discovered this same crash with a different symbol independently this morning and I was coming to file an issue only to find you've done so for me. :D
This is indeed a bug in the way we lookup functions for PGO. Internally, the compiler internally is trying to look up the function as non-generic (because the profile contains the non-generic symbol name), but the function is actually generic and the compiler chokes. We should fix this.
@gopherbot Please backport to 1.21 and 1.22. This is a build failure with PGO if a hot function is changed from non-generic to generic. Only workarounds are to rename the symbol or disable PGO.
Activity
konradreiche commentedon Feb 8, 2024
I assume this isn't expected because according to the PGO documentation a change to the source code could result in performance degradation but not necessarily compilation failure.
prattmic commentedon Feb 8, 2024
Thanks for filing this! We discovered this same crash with a different symbol independently this morning and I was coming to file an issue only to find you've done so for me. :D
This is indeed a bug in the way we lookup functions for PGO. Internally, the compiler internally is trying to look up the function as non-generic (because the profile contains the non-generic symbol name), but the function is actually generic and the compiler chokes. We should fix this.
prattmic commentedon Feb 8, 2024
@gopherbot Please backport to
1.21 and1.22. This is a build failure with PGO if a hot function is changed from non-generic to generic. Only workarounds are to rename the symbol or disable PGO.gopherbot commentedon Feb 8, 2024
Backport issue(s) opened:
#65617 (for 1.21),#65618 (for 1.22).Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.
gopherbot commentedon Feb 8, 2024
Change https://go.dev/cl/562737 mentions this issue:
cmd/compile: fail noder.LookupFunc gracefully if function genericgopherbot commentedon Feb 9, 2024
Change https://go.dev/cl/563016 mentions this issue:
[release-branch.go1.22] cmd/compile: fail noder.LookupFunc gracefully if function genericcmd/compile: fail noder.LookupFunc gracefully if function generic
[release-branch.go1.22] cmd/compile: fail noder.LookupFunc gracefully…
cmd/compile: fail noder.LookupFunc gracefully if function generic
[release-branch.go1.22] cmd/compile: fail noder.LookupFunc gracefully…
[release-branch.go1.22] cmd/compile: fail noder.LookupFunc gracefully…