go-tools icon indicating copy to clipboard operation
go-tools copied to clipboard

panic: runtime error: index out of range [4] with length 4

Open uhthomas opened this issue 2 years ago • 2 comments

go version: 1.18 statticheck: v0.3.0

(00:37:55) ERROR: /home/thomas/.cache/bazel/_bazel_thomas/b3860946b0ed29b82afe181b73c30609/external/com_github_gofrs_uuid/BUILD.bazel:3:11: GoCompilePkg external/com_github_gofrs_uuid/uuid.a failed: (Exit 1): builder failed: error executing command bazel-out/host/bin/external/go_sdk/builder compilepkg -sdk external/go_sdk -installsuffix linux_amd64 -src external/com_github_gofrs_uuid/codec.go -src external/com_github_gofrs_uuid/generator.go -src ... (remaining 19 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
compilepkg: panic: runtime error: index out of range [4] with length 4

goroutine 255 [running]:
go/types.(*Tuple).At(...)
        GOROOT/src/go/types/tuple.go:31
honnef.co/go/tools/analysis/facts/typedness.impl(0xc00087e8f0, 0xc000aef540, 0xc0008cbcc0)
        external/co_honnef_go_tools/analysis/facts/typedness/typedness.go:236 +0x593
honnef.co/go/tools/analysis/facts/typedness.run(0xc00087e8f0)
        external/co_honnef_go_tools/analysis/facts/typedness/typedness.go:60 +0x10f
main.(*action).execOnce(0xc00053a1b0)
        external/io_bazel_rules_go/go/tools/builders/nogo_main.go:288 +0x817
sync.(*Once).doSlow(0x0?, 0xc000a1e780?)
        GOROOT/src/sync/once.go:68 +0xc2
sync.(*Once).Do(...)
        GOROOT/src/sync/once.go:59
main.(*action).exec(0x0?)
        external/io_bazel_rules_go/go/tools/builders/nogo_main.go:232 +0x3d
main.execAll.func1(0x0?)
        external/io_bazel_rules_go/go/tools/builders/nogo_main.go:226 +0x54
created by main.execAll
        external/io_bazel_rules_go/go/tools/builders/nogo_main.go:224 +0x47

uhthomas avatar Mar 30 '22 23:03 uhthomas

Please fill out the issue template and provide instructions on how I can reproduce the issue, namely where the code is and what commands you used.

I've tried guessing from your output and ran Staticcheck against github.com/gofrs/uuid, which worked fine.

dominikh avatar Mar 31 '22 02:03 dominikh

Saw this again for io_k8s_sigs_kustomize_api/internal/git/BUILD.bazel:3:11. Again apologies for not being able to provide a good reproduction. It's intermittent and confusing.

compilepkg: panic: runtime error: index out of range [7] with length 7

uhthomas avatar May 04 '22 16:05 uhthomas