Skip to content

x/tools/gopls: runtime error: index out of range [495] #61670

@sylr

Description

@sylr

gopls version

Build info
----------
golang.org/x/tools/gopls v0.13.0
    golang.org/x/tools/gopls@v0.13.0 h1:ZUvkm53dJpJ9sUXWtgH39rD53JyQ9/vwB1cpI7swnGo=
    github.com/BurntSushi/toml@v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
    github.com/google/go-cmp@v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/exp@v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=
    golang.org/x/exp/typeparams@v0.0.0-20221212164502-fae10dda9338 h1:2O2DON6y3XMJiQRAS1UWU+54aec2uopH3x7MAiqGW6Y=
    golang.org/x/mod@v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
    golang.org/x/sync@v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
    golang.org/x/sys@v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
    golang.org/x/text@v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4=
    golang.org/x/tools@v0.11.1-0.20230727183555-65b14ec44dc9 h1:KyJgiheQsNju4tb8D6MzAlWqI0YS5LbPyDgitUfKCZg=
    golang.org/x/vuln@v0.0.0-20230110180137-6ad3e3d07815 h1:A9kONVi4+AnuOr1dopsibH6hLi1Huy54cbeJxnq4vmU=
    honnef.co/go/tools@v0.4.2 h1:6qXr+R5w+ktL5UkwEbPp+fEvfyoMPche6GkOpGHZcLc=
    mvdan.cc/gofumpt@v0.4.0 h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM=
    mvdan.cc/xurls/v2@v2.4.0 h1:tzxjVAj+wSBmDcF6zBB7/myTy3gX9xvi8Tyr28AuQgc=
go: go1.20.6

go env

GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/sylvain/Library/Caches/go-build"
GOENV="/Users/sylvain/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/sylvain/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/sylvain/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/homebrew/Cellar/go/1.20.6/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/homebrew/Cellar/go/1.20.6/libexec/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.20.6"
GCCGO="gccgo"
AR="ar"
CC="cc"
CXX="c++"
CGO_ENABLED="1"
GOMOD="/Users/sylvain/git/<redacted>/go.mod"
GOWORK="/Users/sylvain/git/<redacted>/go.work"
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 -fdebug-prefix-map=/var/folders/jq/lq71x93965l422wp3h87r1lr0000gn/T/go-build696922228=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Upgraded from something pre v0.13.0 to v0.13.0 and got errors.

What did you expect to see?

No errors.

What did you see instead?

could not import github.com/company/project (import failed for "github.com/company/project": internal error while importing "github.com/company/project" (runtime error: index out of range [495] with length 16); please report an issue)compilerBrokenImport

Editor and settings

VSCode / Go

Logs

[Info  - 16:09:52] 2023/07/31 16:09:52 go info for /Users/sylvain/git/<redacted>
(go dir /Users/sylvain/git/<redacted>)
(go version go version go1.20.6 darwin/arm64)
(valid build configuration = true)
(build flags: [-tags sql_scanner,goexperiment.arenas])
(selected go env: [GO111MODULE=, GOCACHE=/Users/sylvain/Library/Caches/go-build, GOFLAGS=, GOMODCACHE=/Users/sylvain/go/pkg/mod, GOPATH=/Users/sylvain/go, GOPRIVATE=, GOROOT=/opt/homebrew/Cellar/go/1.20.6/libexec, GOWORK=/Users/sylvain/git/<redacted>/go.work])


[Info  - 16:09:52] 2023/07/31 16:09:52 go/packages.Load #1
	snapshot=0
	directory=file:///Users/sylvain/git/<redacted>
	query=[/Users/sylvain/git/<redacted>/... /Users/sylvain/git/btree/... /Users/sylvain/git/fixed/... /Users/sylvain/git/go-timeutils/... /Users/sylvain/git/pgx/... builtin]
	packages=106

[Info  - 16:09:52] 2023/07/31 16:09:52 go/packages.Load #1: updating metadata for 376 packages

[Error - 16:09:53] 2023/07/31 16:09:53 computing the shared import graph: import failed for "github.com/company/project": internal error while importing "github.com/company/project" (runtime error: index out of range [495] with length 16); please report an issue

[Error - 16:09:58] 2023/07/31 16:09:58 computing the shared import graph: import failed for "github.com/company/project": internal error while importing "github.com/company/project" (runtime error: index out of range [495] with length 16); please report an issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions