Repository navigation
Closed
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.CriticalA critical problem that affects the availability or correctness of production systems built using GoA critical problem that affects the availability or correctness of production systems built using GoFixPendingIssues that have a fix which has not yet been reviewed or submitted.Issues that have a fix which has not yet been reviewed or submitted.FrozenDueToAgeImplementationIssues describing a semantics-preserving change to the Go implementation.Issues describing a semantics-preserving change to the Go implementation.NeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.
Milestone
Description
Go version
go version go1.24.0 darwin/arm64
Output of go env in your module/workspace:
AR='ar'
CC='clang'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='clang++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/Users/hanifrmn/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/hanifrmn/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/xd/37pvgts12bg_bk2wx9kp9gbm0000gp/T/go-build2186527099=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/Users/hanifrmn/Repo/playground/go.mod'
GOMODCACHE='/Users/hanifrmn/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/hanifrmn/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/hanifrmn/sdk/go1.24.0'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/hanifrmn/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/hanifrmn/sdk/go1.24.0/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.24.0'
GOWORK=''
PKG_CONFIG='pkg-config'What did you do?
package main
import (
"math"
)
func main() {
test(2)
}
func test(i int) {
if i <= 0 {
return
}
_ = math.Pow10(i + 2)
}running go build will freeze the compiler
What did you see happen?
Running go build will freeze the compiler
Running with -gcflags=-l rans fine
What did you expect to see?
It compiles correctly on Go 1.23.6
Reacted by jub0bs and sudo pacman -Syu
Metadata
Metadata
Assignees
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.CriticalA critical problem that affects the availability or correctness of production systems built using GoA critical problem that affects the availability or correctness of production systems built using GoFixPendingIssues that have a fix which has not yet been reviewed or submitted.Issues that have a fix which has not yet been reviewed or submitted.FrozenDueToAgeImplementationIssues describing a semantics-preserving change to the Go implementation.Issues describing a semantics-preserving change to the Go implementation.NeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.
Activity
[-]math: Pow10 freeze the compiler on certain condition[/-][+]math: Pow10 freeze the compiler on certain condition on Go 1.24[/+]gabyhelp commentedon Feb 20, 2025
Related Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Jorropo commentedon Feb 20, 2025
etrnal70 commentedon Feb 20, 2025
etrnal70 commentedon Feb 20, 2025
Jorropo commentedon Feb 20, 2025
Well I am very confused:
820f58a is very simple, copying patterns and code from other patches.
I don't know when I'll be able to spend time investigating this,
I'll revert that for 1.24.1 but I think there is a latent bug hiding somewhere.
gopherbot commentedon Feb 20, 2025
Change https://go.dev/cl/650975 mentions this issue:
Revert "cmd/compile: compute Negation's limits from argument's limits"Jorropo commentedon Feb 20, 2025
cc @golang/compiler
Jorropo commentedon Feb 20, 2025
@gopherbot Please open backport issue for 1.24
This is a regression where non esoteric code that used to build now does not.
https://gophers.slack.com/archives/C6CM8NUEB/p1740060033459149
gopherbot commentedon Feb 20, 2025
Backport issue(s) opened: #71855 (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.
Jorropo commentedon Feb 20, 2025
Thanks to @etrnal70's reproducer I was able to preliminarily narrow down the issue to a bug in
newLimit.There is a loop permanently doing this operation in the flowLimit loop:
Altho you might note that the limits do not change YET
newLimitreturnstruewhich cause the loop to never break since it thinks the values are being forever narrowed down when they are not.gopherbot commentedon Feb 20, 2025
Change https://go.dev/cl/650580 mentions this issue:
cmd/compile: stop flowLimit search when we proved unsatJorropo commentedon Feb 20, 2025
I've submitted two different proper fixes:
My original plan to revert 820f58a would not solve all regression cases, just this particular one.
I think the only correct revert would involve reverting most of @randall77's prove constants handling improvements, so I think we should consider backporting the fix altho this is more risky.
[-]math: Pow10 freeze the compiler on certain condition on Go 1.24[/-][+]cmd/compile: Pow10 freeze the compiler on certain condition on Go 1.24[/+]cmd/compile: don't report newLimit discovered when unsat happens mult…