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/go: panic when go getting exp/slices and project contains old dependencies #61738

Closed
andoks opened this issue Aug 3, 2023 · 5 comments
Closed
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@andoks
Copy link

andoks commented Aug 3, 2023

What version of Go are you using (go version)?

$ go version
go version go1.20.2 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env | sed -e "s/$USER//g"
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home//.cache/go-build"
GOENV="/home//.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home//.local/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home//.local/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home//.local/lib/go1.20.2.linux-amd64"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home//.local/lib/go1.20.2.linux-amd64/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.2"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home//devel/go-test-get-slices/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 -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2542529713=/tmp/go-build -gno-record-gcc-switches"

What did you do?

With the following go.mod file i ran go get golang.org/x/exp/slices@v0.0.0-20230801115018-d63ba01acd4b and got a panic in the go tool:

go get golang.org/x/exp/slices@v0.0.0-20230801115018-d63ba01acd4b Output
panic: internal error: can't find reason for requirement on golang.org/x/crypto@v0.0.0-20210921155107-089bfa567519

goroutine 1 [running]:
cmd/go/internal/modget.(*resolver).updateBuildList.func1({{0xc000e7e720, 0x13}, {0xc000030e40, 0x22}})
/usr/local/go/src/cmd/go/internal/modget/get.go:1760 +0xd4
cmd/go/internal/modget.(*resolver).updateBuildList(0xc000130000, {0xb434f8, 0xc00002e0c8}, {0x0, 0x0, 0x0})
/usr/local/go/src/cmd/go/internal/modget/get.go:1765 +0x54c
cmd/go/internal/modget.(*resolver).resolveQueries(0xc000130000, {0xb434f8, 0xc00002e0c8}, {0xc0000140a0, 0x1, 0xc0000f7d70?})
/usr/local/go/src/cmd/go/internal/modget/get.go:1243 +0x1b1
cmd/go/internal/modget.runGet({0xb434f8, 0xc00002e0c8}, 0xc000028618?, {0xc0000241a0, 0x1, 0x1})
/usr/local/go/src/cmd/go/internal/modget/get.go:314 +0x408
main.invoke(0xe5a320, {0xc000024190, 0x2, 0x2})
/usr/local/go/src/cmd/go/main.go:225 +0x3d9
main.main()
/usr/local/go/src/cmd/go/main.go:179 +0x7ce

cat go.mod Output
module test_slices

go 1.20

require (
github.com/alexflint/go-arg v1.3.0
github.com/dmarkham/enumer v1.5.8
github.com/fxamacker/cbor/v2 v2.3.0
github.com/golang/gddo v0.0.0-20200831202555-721e228c7686
github.com/influxdata/influxdb v1.8.3
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99
github.com/json-iterator/go v1.1.10
github.com/machinebox/graphql v0.2.2
github.com/microcosm-cc/bluemonday v1.0.4
github.com/pdfcpu/pdfcpu v0.3.9
github.com/prometheus/client_golang v1.8.0
github.com/rickb777/date v1.14.2
github.com/russross/blackfriday v1.5.2
github.com/schollz/progressbar/v3 v3.6.1
github.com/stretchr/testify v1.6.1
github.com/thecodingmachine/gotenberg-go-client/v7 v7.1.0
gitlab.com/andtoeoks/go-licenses v0.0.0-20210119161732-4b016c7901d7
go.uber.org/zap v1.16.0
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
honnef.co/go/tools v0.3.3
)

require (
github.com/BurntSushi/toml v0.4.1 // indirect
github.com/alexflint/go-scalar v1.0.0 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/chris-ramon/douceur v0.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/golang/protobuf v1.4.3 // indirect
github.com/google/licenseclassifier v0.0.0-20190926221455-842c0d70d702 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/hhrutter/lzw v0.0.0-20190829144645-6f07a24e8650 // indirect
github.com/hhrutter/tiff v0.0.0-20190829141212-736cae8d0bc7 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect
github.com/matryer/is v1.4.0 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/otiai10/copy v1.2.0 // indirect
github.com/pascaldekloe/name v1.0.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.14.0 // indirect
github.com/prometheus/procfs v0.2.0 // indirect
github.com/rickb777/plural v1.2.2 // indirect
github.com/sergi/go-diff v1.0.0 // indirect
github.com/spf13/cobra v0.0.5 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/src-d/gcfg v1.4.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xanzy/ssh-agent v0.2.1 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect
golang.org/x/image v0.0.0-20200927104501-e162460cd6b5 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/tools v0.1.12 // indirect
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect
gopkg.in/src-d/go-git.v4 v4.13.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
)

By running a full update of the dependencies with go get -u ./... the problem seems to vanish

What did you expect to see?

Assuming this happens due to outdated dependencies, a message stating the fact. But not that the go tool panics

What did you see instead?

The panic

@andig
Copy link
Contributor

andig commented Aug 3, 2023

fwiw: I can repro when starting with given go.mod on 1.20.7 and darwin/arm. I cannot repro using gotip.

@dr2chase dr2chase added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 3, 2023
@dr2chase
Copy link
Contributor

dr2chase commented Aug 3, 2023

@bcmills

@andoks
Copy link
Author

andoks commented Aug 3, 2023

I was also able to reproduce it with the same go.mod file with 1.20.6 on a second linux/amd64 machine. While using gotip succeeds with output stating that various packages were updated, I assume to be able to install the specified package.

@bcmills
Copy link
Member

bcmills commented Aug 7, 2023

Duplicate of #56494

@bcmills bcmills marked this as a duplicate of #56494 Aug 7, 2023
@bcmills bcmills closed this as completed Aug 7, 2023
@bcmills bcmills closed this as not planned Won't fix, can't repro, duplicate, stale Aug 7, 2023
@bcmills
Copy link
Member

bcmills commented Aug 7, 2023

Duplicate of #55955

@bcmills bcmills marked this as a duplicate of #55955 Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants