Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/link: failed installation due to index out of range #52736

Closed
stevenwjy opened this issue May 6, 2022 · 3 comments
Closed

cmd/link: failed installation due to index out of range #52736

stevenwjy opened this issue May 6, 2022 · 3 comments
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@stevenwjy
Copy link

stevenwjy commented May 6, 2022

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.

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels May 6, 2022
@gopherbot gopherbot added this to the Unreleased milestone May 6, 2022
@suzmue
Copy link
Contributor

suzmue commented May 6, 2022

This looks like an issue with cmd/link not gopls, so I am updating the title accordingly.

@suzmue suzmue changed the title x/tools/gopls: failed installation due to index out of range cmd/link: failed installation due to index out of range May 6, 2022
@suzmue suzmue removed gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. labels May 6, 2022
@cherrymui
Copy link
Member

cherrymui commented 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?

@cherrymui cherrymui added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label May 6, 2022
@stevenwjy
Copy link
Author

stevenwjy commented 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 and go clean -modcache. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants