Closed
Description
Go version
go version go1.22.2 darwin/arm64
Output of go env
in your module/workspace:
GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/mmp/Library/Caches/go-build'
GOENV='/Users/mmp/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/mmp/go/pkg/mod'
GONOPROXY='github.com/mmp/vatce'
GONOSUMDB='github.com/mmp/vatce'
GOOS='darwin'
GOPATH='/Users/mmp/go'
GOPRIVATE='github.com/mmp/vatce'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/Cellar/go/1.22.2/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.22.2/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.2'
GCCGO='gccgo'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/Users/mmp/bork/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/d9/9chq958s5sq76cb02ws8cgkr0000gp/T/go-build2438242053=/tmp/go-build -gno-record-gcc-switches -fno-common'
What did you do?
% go build .
Repo: bork.zip
I have determined that changing line 412 of fonts.go
from:
for j := range glyph.Bounds[0]
to
for j := 0; j < glyph.Bounds[0]; j++ {
makes the compiler stop crashing.
What did you see happen?
% go build .
# github.com/mmp/imgui-go/v4
warning: unknown warning option '-Wno-subobject-linkage' [-Wunknown-warning-option]
# github.com/mmp/vice
<unknown line number>: internal compiler error: panic: runtime error: invalid memory address or nil pointer dereference
Please file a bug report including a short program that triggers the error.
https://go.dev/issue/new
%
What did you expect to see?
Successful compilation of my program.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done
Relationships
Development
No branches or pull requests
Activity
[-]pkg/tool/compile: internal compiler error: panic with range over integer value[/-][+]cmd/compile: internal compiler error: panic with range over integer value[/+]seankhliao commentedon May 2, 2024
stacktrace:
griesemer commentedon May 16, 2024
I cannot reproduce this, neither at go1.22.3 nor at tip (haven't tried go1.22.2). In both cases, the build terminates.
The offending for statement (playground) also works fine stand-alone.
Can you please try this again with the latest version of go1.22, or if you don't mind, at tip?
I'm going to close this for now as not reproducible, but feel free to reopen if you still see the problem with up-to-date compilers. If you see the problem, it would be helpful if you could reduced the source to a (ideally small) snippet of code.
mmp commentedon May 16, 2024
I'm still seeing it here with 1.22.3 as well as with gotip at
And yes, I couldn't come up with a small repo case in the playground, so unfortunately it's this big blob of code.
The stacktrace I get with gotip is similar to the one that @seankhliao posted; the one I got is copied below. Let me know if I can help with further digging here...
mmp commentedon May 16, 2024
(I'm unable to reopen the bug myself, it seems.)
19 remaining items