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: "go list -m -json all" hangs for project with go.work #51919

Closed
sergunya opened this issue Mar 24, 2022 · 3 comments
Closed

cmd/go: "go list -m -json all" hangs for project with go.work #51919

sergunya opened this issue Mar 24, 2022 · 3 comments
Labels
FrozenDueToAge GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@sergunya
Copy link

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

go version go1.18 windows/amd64

Does this issue reproduce with the latest release?

Yes, it does

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

go env Output
$ go env
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\sergey.larionov\AppData\Local\go-build
set GOENV=C:\Users\sergey.larionov\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\sergey.larionov\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\sergey.larionov\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Users\sergey.larionov\go\go1.18
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Users\sergey.larionov\go\go1.18\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.18
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\sergey.larionov\GolandProjects\multi_packages\go.mod
set GOWORK=C:\Users\sergey.larionov\GolandProjects\multi_packages\go.work
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\SERGEY~1.LAR\AppData\Local\Temp\go-build3335278556=/tmp/go-bu
ild -gno-record-gcc-switches

What did you do?

What did you expect to see?

The command finishes with result.

What did you see instead?

The command hangs.

@sergunya sergunya changed the title cmd/go: "go list -m all" hangs for project with go.work cmd/go: "go list -m -json all" hangs for project with go.work Mar 24, 2022
@seankhliao seankhliao added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. GoCommand cmd/go labels Mar 24, 2022
@seankhliao
Copy link
Member

I see several potential problems:

There's a go.mod at the root, but the go.work doesn't use that module, maybe it should be an error?
The go.mod files use require some-module latest, which should also be an error? It is if you try to run go mod tidy on it, and using a version number returns quickly with an error.

cc @matloob @bcmills

@bcmills
Copy link
Member

bcmills commented Jul 18, 2022

I think this is a variation on #53874: an error in a dependency within the workspace causes that dependency to be repeatedly reloaded in a loop.

/tmp/multi_packages$ go1.18.4 list -m -json all
^\SIGQUIT: quit
PC=0x467541 m=0 sigcode=128

goroutine 0 [idle]:
runtime.futex()
        /usr/local/go/src/runtime/sys_linux_amd64.s:552 +0x21
runtime.futexsleep(0x184e832f3b0?, 0xe832f413?, 0x7ffd933eb588?)
        /usr/local/go/src/runtime/os_linux.go:66 +0x36
runtime.notesleep(0xdc6028)
        /usr/local/go/src/runtime/lock_futex.go:159 +0x87
runtime.mPark(...)
        /usr/local/go/src/runtime/proc.go:1449
runtime.stopm()
        /usr/local/go/src/runtime/proc.go:2228 +0x8d
runtime.findrunnable()
        /usr/local/go/src/runtime/proc.go:2804 +0x865
runtime.schedule()
        /usr/local/go/src/runtime/proc.go:3187 +0x239
runtime.park_m(0xc0004b6000?)
        /usr/local/go/src/runtime/proc.go:3336 +0x14d
runtime.mcall()
        /usr/local/go/src/runtime/asm_amd64.s:425 +0x43

goroutine 1 [chan receive]:
cmd/go/internal/modload.readModGraph({0x7dc488?, 0x3?}, 0x2, {0xc0004ec1e0?, 0x3, 0x3})
        /usr/local/go/src/cmd/go/internal/modload/buildlist.go:431 +0x4b3
cmd/go/internal/modload.(*Requirements).Graph.func1()
        /usr/local/go/src/cmd/go/internal/modload/buildlist.go:242 +0x3e
sync.(*Once).doSlow(0x936720?, 0xc0002be090?)
        /usr/local/go/src/sync/once.go:68 +0xc2
sync.(*Once).Do(...)
        /usr/local/go/src/sync/once.go:59
cmd/go/internal/modload.(*Requirements).Graph(0xc0004da230?, {0xaddd78?, 0xc0000b0000?})
        /usr/local/go/src/cmd/go/internal/modload/buildlist.go:241 +0x74
cmd/go/internal/modload.expandGraph({0xaddd78, 0xc0000b0000}, 0xc0004da230)
        /usr/local/go/src/cmd/go/internal/modload/buildlist.go:559 +0x45
cmd/go/internal/modload.listModules({0xaddd78, 0xc0000b0000}, 0xc0004da230, {0xc0000ca040, 0x1, 0x40?}, 0x0)
        /usr/local/go/src/cmd/go/internal/modload/list.go:130 +0x5af
cmd/go/internal/modload.ListModules({0xaddd78, 0xc0000b0000}, {0xc0000ca040, 0x1, 0x1}, 0x0)
        /usr/local/go/src/cmd/go/internal/modload/list.go:38 +0x93
cmd/go/internal/list.runList({0xaddd78?, 0xc0000b0000}, 0xc0000e0240?, {0xc0000ca040?, 0x1, 0x1})
        /usr/local/go/src/cmd/go/internal/list/list.go:469 +0x277f
main.invoke(0xdb8040, {0xc0000ca010, 0x4, 0x4})
        /usr/local/go/src/cmd/go/main.go:218 +0x2ee
main.main()
        /usr/local/go/src/cmd/go/main.go:175 +0x78e

goroutine 8 [IO wait]:
internal/poll.runtime_pollWait(0x7f84e8440eb8, 0x72)
        /usr/local/go/src/runtime/netpoll.go:302 +0x89
internal/poll.(*pollDesc).wait(0xc0000e4600?, 0xc0001a8000?, 0x0)
        /usr/local/go/src/internal/poll/fd_poll_runtime.go:83 +0x32
internal/poll.(*pollDesc).waitRead(...)
        /usr/local/go/src/internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Read(0xc0000e4600, {0xc0001a8000, 0x2a55, 0x2a55})
        /usr/local/go/src/internal/poll/fd_unix.go:167 +0x25a
net.(*netFD).Read(0xc0000e4600, {0xc0001a8000?, 0xc000181a58?, 0xc0000b5808?})
        /usr/local/go/src/net/fd_posix.go:55 +0x29
net.(*conn).Read(0xc000010010, {0xc0001a8000?, 0xc0001a4d10?, 0x2c?})
        /usr/local/go/src/net/net.go:183 +0x45
crypto/tls.(*atLeastReader).Read(0xc000264288, {0xc0001a8000?, 0x0?, 0x1baf4439a124ab02?})
        /usr/local/go/src/crypto/tls/conn.go:785 +0x3d
bytes.(*Buffer).ReadFrom(0xc000192278, {0xad9280, 0xc000264288})
        /usr/local/go/src/bytes/buffer.go:204 +0x98
crypto/tls.(*Conn).readFromUntil(0xc000192000, {0xad97e0?, 0xc000010010}, 0x200000003?)
        /usr/local/go/src/crypto/tls/conn.go:807 +0xe5
crypto/tls.(*Conn).readRecordOrCCS(0xc000192000, 0x0)
        /usr/local/go/src/crypto/tls/conn.go:614 +0x116
crypto/tls.(*Conn).readRecord(...)
        /usr/local/go/src/crypto/tls/conn.go:582
crypto/tls.(*Conn).Read(0xc000192000, {0xc00022e000, 0x1000, 0x11?})
        /usr/local/go/src/crypto/tls/conn.go:1285 +0x16f
bufio.(*Reader).Read(0xc000038de0, {0xc0001f2ba0, 0x9, 0xc0000b5d18?})
        /usr/local/go/src/bufio/bufio.go:236 +0x1b4
io.ReadAtLeast({0xad8aa0, 0xc000038de0}, {0xc0001f2ba0, 0x9, 0x9}, 0x9)
        /usr/local/go/src/io/io.go:331 +0x9a
io.ReadFull(...)
        /usr/local/go/src/io/io.go:350
net/http.http2readFrameHeader({0xc0001f2ba0?, 0x9?, 0xc0000b5df0?}, {0xad8aa0?, 0xc000038de0?})
        /usr/local/go/src/net/http/h2_bundle.go:1566 +0x6e
net/http.(*http2Framer).ReadFrame(0xc0001f2b60)
        /usr/local/go/src/net/http/h2_bundle.go:1830 +0x95
net/http.(*http2clientConnReadLoop).run(0xc0000b5f98)
        /usr/local/go/src/net/http/h2_bundle.go:8815 +0x130
net/http.(*http2ClientConn).readLoop(0xc000190180)
        /usr/local/go/src/net/http/h2_bundle.go:8711 +0x6f
created by net/http.(*http2Transport).newClientConn
        /usr/local/go/src/net/http/h2_bundle.go:7439 +0xa65

goroutine 6640745 [runnable]:
cmd/go/internal/par.(*Cache).Do(0xc0004ec248, {0x98a080, 0xc0003fca20}, 0xc000639eb0)
        /usr/local/go/src/cmd/go/internal/par/work.go:119 +0x14c
cmd/go/internal/modload.readModGraph.func2({{0xc0004e0210?, 0x3?}, {0x0?, 0x407d30?}})
        /usr/local/go/src/cmd/go/internal/modload/buildlist.go:329 +0x132
cmd/go/internal/modload.readModGraph.func3.1()
        /usr/local/go/src/cmd/go/internal/modload/buildlist.go:362 +0x44
cmd/go/internal/par.(*Queue).Add.func1()
        /usr/local/go/src/cmd/go/internal/par/queue.go:58 +0x7d
created by cmd/go/internal/par.(*Queue).Add
        /usr/local/go/src/cmd/go/internal/par/queue.go:56 +0x225

rax    0xca
rbx    0x0
rcx    0x467543
rdx    0x0
rdi    0xdc6028
rsi    0x80
rbp    0x7ffd933eb540
rsp    0x7ffd933eb4f8
r8     0x0
r9     0x0
r10    0x0
r11    0x286
r12    0x129c4
r13    0xb
r14    0xdc50e0
r15    0x7f84e9dc3710
rip    0x467541
rflags 0x286
cs     0x33
fs     0x0
gs     0x0

/tmp/multi_packages$ gotip list -m -json all
go: module github.com/h31/multi_packages/package_1: parsing package_1/go.mod: /tmp/multi_packages/package_1/go.mod:6:2: require github.com/h31/multi_packages/package_2: version "latest" invalid: must be of the form v1.2.3
/tmp/multi_packages/package_1/go.mod:7:2: require github.com/h31/multi_packages/package_3: version "latest" invalid: must be of the form v1.2.3

@bcmills
Copy link
Member

bcmills commented Jul 18, 2022

Duplicate of #53874

@bcmills bcmills marked this as a duplicate of #53874 Jul 18, 2022
@bcmills bcmills closed this as completed Jul 18, 2022
@bcmills bcmills added this to the Go1.19 milestone Jul 18, 2022
@golang golang locked and limited conversation to collaborators Jul 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge GoCommand cmd/go modules 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