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: git ls-remote stuck without timeout #31073

Open
schittler opened this Issue Mar 27, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@schittler
Copy link

commented Mar 27, 2019

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

$ go version
go version go1.12 darwin/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
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/gant/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/gant/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/rd/xlgb151n6lj9k2mc5wkz7fdr0000gn/T/go-build357164089=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

go mod vendor

What did you expect to see?

Process finishing / retrying.

What did you see instead?

Program randomly gets stuck on version selection. Checking the process tree reveals it to be waiting for git ls-remote. This happens on private repos to which access is configured via insteadOf https to ssh rewrite in .gitconfig and on public repos (e.g. spf13/pflag).

@mvdan mvdan added the modules label Mar 27, 2019

@agnivade

This comment has been minimized.

Copy link
Member

commented Mar 27, 2019

Can you give us the exact repro steps ?

Can you send a SIGQUIT (Ctrl + \) to the process when it gets stuck and post a goroutine trace ?

@schittler

This comment has been minimized.

Copy link
Author

commented Apr 9, 2019

Not really any steps involved, it just stops doing anything most of the time for me - very likely waiting for git ls-remote to do anything.

This trace is from a mod init - but it runs into the same issue.

SIGQUIT Output
go: creating new go.mod: module github.com/fid-dev/metricsd
go: copying requirements from Gopkg.lock
SIGQUIT: quit
PC=0x7fff5f1b086a m=0 sigcode=0

goroutine 0 [idle]:
runtime.pthread_cond_wait(0x1a4e3a8, 0x1a4e368, 0xc000000000)
/usr/local/Cellar/go/1.12/libexec/src/runtime/sys_darwin.go:357 +0x3b
runtime.semasleep(0xffffffffffffffff, 0xc00009c300)
/usr/local/Cellar/go/1.12/libexec/src/runtime/os_darwin.go:63 +0x85
runtime.notesleep(0x1a4e168)
/usr/local/Cellar/go/1.12/libexec/src/runtime/lock_sema.go:167 +0xe0
runtime.stopm()
/usr/local/Cellar/go/1.12/libexec/src/runtime/proc.go:1936 +0xc1
runtime.findrunnable(0xc000043900, 0x0)
/usr/local/Cellar/go/1.12/libexec/src/runtime/proc.go:2399 +0x530
runtime.schedule()
/usr/local/Cellar/go/1.12/libexec/src/runtime/proc.go:2525 +0x20e
runtime.park_m(0xc00009c300)
/usr/local/Cellar/go/1.12/libexec/src/runtime/proc.go:2605 +0xa1
runtime.mcall(0x105764b)
/usr/local/Cellar/go/1.12/libexec/src/runtime/asm_amd64.s:299 +0x5b

goroutine 1 [sync.Cond.Wait, 4 minutes]:
runtime.goparkunlock(...)
/usr/local/Cellar/go/1.12/libexec/src/runtime/proc.go:307
sync.runtime_notifyListWait(0xc0001182c8, 0x3)
/usr/local/Cellar/go/1.12/libexec/src/runtime/sema.go:510 +0xf9
sync.(*Cond).Wait(0xc0001182b8)
/usr/local/Cellar/go/1.12/libexec/src/sync/cond.go:56 +0x91
cmd/go/internal/par.(*Work).runner(0xc000118280)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/par/work.go:87 +0x33
cmd/go/internal/par.(*Work).Do(0xc000118280, 0xa, 0xc00010fe30)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/par/work.go:69 +0xbf
cmd/go/internal/modconv.ConvertLegacyConfig(0xc000214780, 0xc00028db00, 0x39, 0xc0002aa000, 0x5881, 0x5a81, 0x1, 0x29)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/modconv/convert.go:57 +0x30c
cmd/go/internal/modload.legacyModInit()
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/modload/init.go:411 +0x2b2
cmd/go/internal/modload.InitMod()
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/modload/init.go:324 +0x54d
cmd/go/internal/modcmd.runInit(0x1a427a0, 0xc000020050, 0x0, 0x0)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/modcmd/init.go:44 +0xc0
main.main()
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/main.go:219 +0x837

goroutine 4 [syscall, 4 minutes]:
os/signal.signal_recv(0x0)
/usr/local/Cellar/go/1.12/libexec/src/runtime/sigqueue.go:139 +0x9f
os/signal.loop()
/usr/local/Cellar/go/1.12/libexec/src/os/signal/signal_unix.go:23 +0x22
created by os/signal.init.0
/usr/local/Cellar/go/1.12/libexec/src/os/signal/signal_unix.go:29 +0x41

goroutine 34 [sync.Cond.Wait, 4 minutes]:
runtime.goparkunlock(...)
/usr/local/Cellar/go/1.12/libexec/src/runtime/proc.go:307
sync.runtime_notifyListWait(0xc0001182c8, 0x1)
/usr/local/Cellar/go/1.12/libexec/src/runtime/sema.go:510 +0xf9
sync.(*Cond).Wait(0xc0001182b8)
/usr/local/Cellar/go/1.12/libexec/src/sync/cond.go:56 +0x91
cmd/go/internal/par.(*Work).runner(0xc000118280)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/par/work.go:87 +0x33
created by cmd/go/internal/par.(*Work).Do
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/par/work.go:67 +0x9b

goroutine 35 [sync.Cond.Wait, 4 minutes]:
runtime.goparkunlock(...)
/usr/local/Cellar/go/1.12/libexec/src/runtime/proc.go:307
sync.runtime_notifyListWait(0xc0001182c8, 0x0)
/usr/local/Cellar/go/1.12/libexec/src/runtime/sema.go:510 +0xf9
sync.(*Cond).Wait(0xc0001182b8)
/usr/local/Cellar/go/1.12/libexec/src/sync/cond.go:56 +0x91
cmd/go/internal/par.(*Work).runner(0xc000118280)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/par/work.go:87 +0x33
created by cmd/go/internal/par.(*Work).Do
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/par/work.go:67 +0x9b

goroutine 36 [sync.Cond.Wait, 4 minutes]:
runtime.goparkunlock(...)
/usr/local/Cellar/go/1.12/libexec/src/runtime/proc.go:307
sync.runtime_notifyListWait(0xc0001182c8, 0x7)
/usr/local/Cellar/go/1.12/libexec/src/runtime/sema.go:510 +0xf9
sync.(*Cond).Wait(0xc0001182b8)
/usr/local/Cellar/go/1.12/libexec/src/sync/cond.go:56 +0x91
cmd/go/internal/par.(*Work).runner(0xc000118280)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/par/work.go:87 +0x33
created by cmd/go/internal/par.(*Work).Do
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/par/work.go:67 +0x9b

goroutine 37 [sync.Cond.Wait, 4 minutes]:
runtime.goparkunlock(...)
/usr/local/Cellar/go/1.12/libexec/src/runtime/proc.go:307
sync.runtime_notifyListWait(0xc0001182c8, 0x8)
/usr/local/Cellar/go/1.12/libexec/src/runtime/sema.go:510 +0xf9
sync.(*Cond).Wait(0xc0001182b8)
/usr/local/Cellar/go/1.12/libexec/src/sync/cond.go:56 +0x91
cmd/go/internal/par.(*Work).runner(0xc000118280)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/par/work.go:87 +0x33
created by cmd/go/internal/par.(*Work).Do
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/par/work.go:67 +0x9b

goroutine 38 [sync.Cond.Wait, 4 minutes]:
runtime.goparkunlock(...)
/usr/local/Cellar/go/1.12/libexec/src/runtime/proc.go:307
sync.runtime_notifyListWait(0xc0001182c8, 0x2)
/usr/local/Cellar/go/1.12/libexec/src/runtime/sema.go:510 +0xf9
sync.(*Cond).Wait(0xc0001182b8)
/usr/local/Cellar/go/1.12/libexec/src/sync/cond.go:56 +0x91
cmd/go/internal/par.(*Work).runner(0xc000118280)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/par/work.go:87 +0x33
created by cmd/go/internal/par.(*Work).Do
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/par/work.go:67 +0x9b

goroutine 39 [sync.Cond.Wait, 4 minutes]:
runtime.goparkunlock(...)
/usr/local/Cellar/go/1.12/libexec/src/runtime/proc.go:307
sync.runtime_notifyListWait(0xc0001182c8, 0x5)
/usr/local/Cellar/go/1.12/libexec/src/runtime/sema.go:510 +0xf9
sync.(*Cond).Wait(0xc0001182b8)
/usr/local/Cellar/go/1.12/libexec/src/sync/cond.go:56 +0x91
cmd/go/internal/par.(*Work).runner(0xc000118280)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/par/work.go:87 +0x33
created by cmd/go/internal/par.(*Work).Do
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/par/work.go:67 +0x9b

goroutine 40 [sync.Cond.Wait, 4 minutes]:
runtime.goparkunlock(...)
/usr/local/Cellar/go/1.12/libexec/src/runtime/proc.go:307
sync.runtime_notifyListWait(0xc0001182c8, 0x6)
/usr/local/Cellar/go/1.12/libexec/src/runtime/sema.go:510 +0xf9
sync.(*Cond).Wait(0xc0001182b8)
/usr/local/Cellar/go/1.12/libexec/src/sync/cond.go:56 +0x91
cmd/go/internal/par.(*Work).runner(0xc000118280)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/par/work.go:87 +0x33
created by cmd/go/internal/par.(*Work).Do
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/par/work.go:67 +0x9b

goroutine 41 [sync.Cond.Wait, 4 minutes]:
runtime.goparkunlock(...)
/usr/local/Cellar/go/1.12/libexec/src/runtime/proc.go:307
sync.runtime_notifyListWait(0xc0001182c8, 0x4)
/usr/local/Cellar/go/1.12/libexec/src/runtime/sema.go:510 +0xf9
sync.(*Cond).Wait(0xc0001182b8)
/usr/local/Cellar/go/1.12/libexec/src/sync/cond.go:56 +0x91
cmd/go/internal/par.(*Work).runner(0xc000118280)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/par/work.go:87 +0x33
created by cmd/go/internal/par.(*Work).Do
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/par/work.go:67 +0x9b

goroutine 42 [syscall, 4 minutes]:
syscall.syscall6(0x10a2790, 0x3758, 0xc000433424, 0x0, 0xc0005483f0, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.12/libexec/src/runtime/sys_darwin.go:74 +0x2e
syscall.wait4(0x3758, 0xc000433424, 0x0, 0xc0005483f0, 0x90, 0x15c4620, 0xc00040eb01)
/usr/local/Cellar/go/1.12/libexec/src/syscall/zsyscall_darwin_amd64.go:42 +0x88
syscall.Wait4(0x3758, 0xc000433474, 0x0, 0xc0005483f0, 0xc0001fc2a0, 0x1, 0x2)
/usr/local/Cellar/go/1.12/libexec/src/syscall/syscall_bsd.go:129 +0x51
os.(*Process).wait(0xc00040ebd0, 0x1618f18, 0x1618f20, 0x1618f10)
/usr/local/Cellar/go/1.12/libexec/src/os/exec_unix.go:38 +0x7c
os.(*Process).Wait(...)
/usr/local/Cellar/go/1.12/libexec/src/os/exec.go:125
os/exec.(*Cmd).Wait(0xc0002f8420, 0x0, 0x0)
/usr/local/Cellar/go/1.12/libexec/src/os/exec/exec.go:474 +0x61
os/exec.(*Cmd).Run(0xc0002f8420, 0x3, 0xc0001fab50)
/usr/local/Cellar/go/1.12/libexec/src/os/exec/exec.go:318 +0x5c
cmd/go/internal/modfetch/codehost.RunWithStdin(0xc00038a1c0, 0x61, 0x0, 0x0, 0xc000433780, 0x4, 0x4, 0x0, 0x0, 0x0, ...)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/modfetch/codehost/codehost.go:285 +0x676
cmd/go/internal/modfetch/codehost.Run(...)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/modfetch/codehost/codehost.go:225
cmd/go/internal/modfetch/codehost.(*gitRepo).loadRefs(0xc00041c000)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/modfetch/codehost/git.go:165 +0x116
sync.(*Once).Do(0xc00041c068, 0xc0004339f8)
/usr/local/Cellar/go/1.12/libexec/src/sync/once.go:44 +0xb3
cmd/go/internal/modfetch/codehost.(*gitRepo).stat(0xc00041c000, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/modfetch/codehost/git.go:281 +0x145
cmd/go/internal/modfetch/codehost.(*gitRepo).Stat.func1(0xc000116cc4, 0x1525dc0)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/modfetch/codehost/git.go:460 +0x40
cmd/go/internal/par.(*Cache).Do(0xc00041c040, 0x1525dc0, 0x1a6ab60, 0xc000433c20, 0x0, 0x0)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/par/work.go:128 +0xd3
cmd/go/internal/modfetch/codehost.(*gitRepo).Stat(0xc00041c000, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/modfetch/codehost/git.go:459 +0xbd
cmd/go/internal/modfetch/codehost.(*gitRepo).RecentTag(0xc00041c000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/modfetch/codehost/git.go:643 +0x6d
cmd/go/internal/modfetch.(*codeRepo).convert(0xc000476100, 0xc0003c0840, 0x0, 0x0, 0xc0002b0f31, 0x23, 0x16c5cc0)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/modfetch/coderepo.go:230 +0x356
cmd/go/internal/modfetch.ImportRepoRev(0xc0002b0f31, 0x23, 0xc0002b0f77, 0x28, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/modfetch/repo.go:291 +0x2c9
cmd/go/internal/modconv.ConvertLegacyConfig.func1(0x1570580, 0xc000116480)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/modconv/convert.go:59 +0xc0
cmd/go/internal/par.(*Work).runner(0xc000118280)
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/par/work.go:101 +0x135
created by cmd/go/internal/par.(*Work).Do
/usr/local/Cellar/go/1.12/libexec/src/cmd/go/internal/par/work.go:67 +0x9b

goroutine 136 [IO wait, 4 minutes]:
internal/poll.runtime_pollWait(0x4a511a8, 0x72, 0xffffffffffffffff)
/usr/local/Cellar/go/1.12/libexec/src/runtime/netpoll.go:182 +0x56
internal/poll.(*pollDesc).wait(0xc000400a98, 0x72, 0x201, 0x200, 0xffffffffffffffff)
/usr/local/Cellar/go/1.12/libexec/src/internal/poll/fd_poll_runtime.go:87 +0x9b
internal/poll.(*pollDesc).waitRead(...)
/usr/local/Cellar/go/1.12/libexec/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0xc000400a80, 0xc0001cc800, 0x200, 0x200, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.12/libexec/src/internal/poll/fd_unix.go:169 +0x1f2
os.(*File).read(...)
/usr/local/Cellar/go/1.12/libexec/src/os/file_unix.go:263
os.(*File).Read(0xc000010120, 0xc0001cc800, 0x200, 0x200, 0x0, 0x0, 0xc0003b86a0)
/usr/local/Cellar/go/1.12/libexec/src/os/file.go:108 +0x70
bytes.(*Buffer).ReadFrom(0xc0001b6930, 0x16b71e0, 0xc000010120, 0x4a95f98, 0xc0001b6930, 0x1)
/usr/local/Cellar/go/1.12/libexec/src/bytes/buffer.go:207 +0xbd
io.copyBuffer(0x16b66c0, 0xc0001b6930, 0x16b71e0, 0xc000010120, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.12/libexec/src/io/io.go:388 +0x303
io.Copy(...)
/usr/local/Cellar/go/1.12/libexec/src/io/io.go:364
os/exec.(*Cmd).writerDescriptor.func1(0x0, 0x0)
/usr/local/Cellar/go/1.12/libexec/src/os/exec/exec.go:288 +0x63
os/exec.(*Cmd).Start.func1(0xc0002f8420, 0xc000408440)
/usr/local/Cellar/go/1.12/libexec/src/os/exec/exec.go:409 +0x27
created by os/exec.(*Cmd).Start
/usr/local/Cellar/go/1.12/libexec/src/os/exec/exec.go:408 +0x594

goroutine 137 [IO wait, 4 minutes]:
internal/poll.runtime_pollWait(0x1bad828, 0x72, 0xffffffffffffffff)
/usr/local/Cellar/go/1.12/libexec/src/runtime/netpoll.go:182 +0x56
internal/poll.(*pollDesc).wait(0xc0000cad38, 0x72, 0x201, 0x200, 0xffffffffffffffff)
/usr/local/Cellar/go/1.12/libexec/src/internal/poll/fd_poll_runtime.go:87 +0x9b
internal/poll.(*pollDesc).waitRead(...)
/usr/local/Cellar/go/1.12/libexec/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0xc0000cad20, 0xc00051da00, 0x200, 0x200, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.12/libexec/src/internal/poll/fd_unix.go:169 +0x1f2
os.(*File).read(...)
/usr/local/Cellar/go/1.12/libexec/src/os/file_unix.go:263
os.(*File).Read(0xc0000c8160, 0xc00051da00, 0x200, 0x200, 0x0, 0x0, 0xc0003b8ea0)
/usr/local/Cellar/go/1.12/libexec/src/os/file.go:108 +0x70
bytes.(*Buffer).ReadFrom(0xc0001b68a0, 0x16b71e0, 0xc0000c8160, 0x4a95f98, 0xc0001b68a0, 0x1)
/usr/local/Cellar/go/1.12/libexec/src/bytes/buffer.go:207 +0xbd
io.copyBuffer(0x16b66c0, 0xc0001b68a0, 0x16b71e0, 0xc0000c8160, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.12/libexec/src/io/io.go:388 +0x303
io.Copy(...)
/usr/local/Cellar/go/1.12/libexec/src/io/io.go:364
os/exec.(*Cmd).writerDescriptor.func1(0x0, 0x0)
/usr/local/Cellar/go/1.12/libexec/src/os/exec/exec.go:288 +0x63
os/exec.(*Cmd).Start.func1(0xc0002f8420, 0xc0000b27a0)
/usr/local/Cellar/go/1.12/libexec/src/os/exec/exec.go:409 +0x27
created by os/exec.(*Cmd).Start
/usr/local/Cellar/go/1.12/libexec/src/os/exec/exec.go:408 +0x594

rax 0x104
rbx 0x2
rcx 0x7ffeefbff048
rdx 0x1e300
rdi 0x1a4e3a8
rsi 0x1e3010001e400
rbp 0x7ffeefbff0d0
rsp 0x7ffeefbff048
r8 0x0
r9 0xa0
r10 0x0
r11 0x202
r12 0x1a4e3a8
r13 0x16
r14 0x1e3010001e400
r15 0xfb4a5c0
rip 0x7fff5f1b086a
rflags 0x203
cs 0x7
fs 0x0
gs 0x0

@agnivade

This comment has been minimized.

Copy link
Member

commented Apr 9, 2019

@agnivade agnivade changed the title go mod: git ls-remote stuck without timeout cmd/go: git ls-remote stuck without timeout Apr 9, 2019

@agnivade agnivade added this to the Go1.13 milestone Apr 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.