Go version

1.25rc1

Output of go env in your module/workspace:

AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE='on'
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/user/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/user/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build876450102=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/dev/null'
GOMODCACHE='/home/user/go-repos/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/user/go-repos:/opt/go/path:/home/user/go-code'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/user/golang'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/user/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/user/golang/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.25rc1'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

Go 1.25 seemingly introduced some changes that make some code not panic anymore. A minimal repro can be found as following: * Go 1.24.4 (panics): https://go.dev/play/p/yVGJr9Fto9s * Go 1.25rc1 (doesn't panic): https://go.dev/play/p/yVGJr9Fto9s?v=gotip

What did you see happen?

The code did not panic on go 1.25rc1 but it used to do on 1.24.4 and before.

What did you expect to see?

After doing some bisecting, the offending commit seems to be https://github.com/golang/go/commit/ed24bb4e6047890af272733c5a8bdcc43834e517 . In both the repros above and the commit message fmt.Println is used, which receives an interface.

Comment From: thepudds

Thanks for the report. I'll take a look.

Comment From: thepudds

OK, I might see the problem, though I want to poke at it a bit more.

Comment From: gabyhelp

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

Comment From: gopherbot

Change https://go.dev/cl/684116 mentions this issue: cmd/compile/internal/escape: evaluate any side effects when replacing ConvExpr.X for interface conversions

Comment From: thepudds

Hi @sggutier, I need to check and possibly update a couple of other places, but I have a WIP CL 684116 that at least seems to restore expected behavior on your small example:

$ go run .          # want a panic
panic: test error

goroutine 1 [running]:
main.crashOnErr(...)
        cmd/compile/internal/escape/_examples/issue-74379/main.go:10
main.main()
        cmd/compile/internal/escape/_examples/issue-74379/main.go:16 +0x3d
exit status 2

I am still looking at it, but when you have a chance, would you mind trying that CL 684116 on whatever the original problem code was to see if it helps?

One way is via the official gotip utility:

$ go install golang.org/dl/gotip@latest     # install gotip
$ gotip download 684116                     # download and build CL 684116
$ gotip test ./...                          # use gotip as your normal 'go' command

Thanks again for the report, and thanks for the minimal reproducer!

Comment From: sggutier

Thank you so much for the quick response @thepudds, that does indeed solve my issue!