Closed
Description
gopls version
Attempted to install the latest version, i.e.:
go install golang.org/x/tools/gopls@latest
go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/[redacted]/.cache/go-build"
GOENV="/[redacted]/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/[redacted]/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/[redacted]/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2921475380=/tmp/go-build -gno-record-gcc-switches"
What did you do?
Attempted to install the latest version, i.e.:
go install golang.org/x/tools/gopls@latest
What did you expect to see?
Successful installation
What did you see instead?
# golang.org/x/tools/gopls
panic: runtime error: index out of range [2147483627] with length 27
goroutine 1 [running]:
cmd/link/internal/loader.(*Loader).resolve(0x439?, 0xc000f7fe00?, {0x8c0000?, 0xc0?})
/usr/local/go/src/cmd/link/internal/loader/loader.go:667 +0x1ae
cmd/link/internal/loader.Reloc.Sym({0x7f9e1d38edc7?, 0xc000f7fe00?, 0xc0008c0000?})
/usr/local/go/src/cmd/link/internal/loader/loader.go:59 +0x35
cmd/link/internal/loader.(*Loader).UndefinedRelocTargets(0xc0008c0000, 0x1)
/usr/local/go/src/cmd/link/internal/loader/loader.go:2465 +0x1a5
cmd/link/internal/ld.(*Link).loadlib(0xc000196000)
/usr/local/go/src/cmd/link/internal/ld/lib.go:600 +0x5d7
cmd/link/internal/ld.Main(_, {0x20, 0x20, 0x1, 0x7, 0x10, 0x0, {0x0, 0x0}, {0x67f563, ...}, ...})
/usr/local/go/src/cmd/link/internal/ld/main.go:261 +0xe2b
main.main()
/usr/local/go/src/cmd/link/main.go:69 +0xfe5
Editor and settings
None. Initially attempted the installation through VSCode but failed, afterward I tried to run the command directly from terminal and it gave the same error output.
Metadata
Metadata
Assignees
Type
Projects
Relationships
Development
No branches or pull requests
Activity
suzmue commentedon May 6, 2022
This looks like an issue with cmd/link not gopls, so I am updating the title accordingly.
[-]x/tools/gopls: failed installation due to index out of range[/-][+]cmd/link: failed installation due to index out of range[/+]cherrymui commentedon May 6, 2022
What version of Go do you use? I saw
GOVERSION="go1.18"
but I cannot reproduce it with go1.18.Maybe try clean your cache (
go clean -cache
,go clean -modcache
) in case some cached file is corrupted?stevenwjy commentedon May 7, 2022
Ah yeah, sorry it seems like some of my cached files were somehow corrupted. Managed to resolve this with
go clean -cache
andgo clean -modcache
. Thanks!