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

x/vgo: Hangs if SSH ControlPersist is set #25567

Closed
pwaller opened this issue May 25, 2018 · 3 comments
Closed

x/vgo: Hangs if SSH ControlPersist is set #25567

pwaller opened this issue May 25, 2018 · 3 comments
Milestone

Comments

@pwaller
Copy link
Contributor

pwaller commented May 25, 2018

Reproduced with Go 1.10 and golang/vgo@b85f725.

As with #13453 which was fixed in e6a901e, vgo will hang indefinitely if ControlMaster is set and git is configured to always use SSH transport with url.*.insteadOf.


Somewhere in the bowels of my .ssh/config:

ControlPath ~/.ssh/controlmasters/%C
ControlMaster auto
ControlPersist 10m

And in my git config, I have the following, which makes it always use SSH (so that I may import private repositories):

[url "ssh://git@github.com/"]
        insteadOf = https://github.com/

The effect is that vgo hangs when doing various operations. I've witnessed it hanging doing a vgo install and a vgo list -t.


I believe a valid fix would be to do what is done in e6a901e. I've tested that locally if I set GIT_SSH_COMMAND to include -o ControlPersist=no in codehost/codehost.go:Run(), then it works as expected.

@gopherbot gopherbot added this to the vgo milestone May 25, 2018
@pwaller pwaller changed the title x/vgo: Hangs if ControlPersist is set x/vgo: Hangs if SSH ControlPersist is set May 25, 2018
@pwaller
Copy link
Contributor Author

pwaller commented May 25, 2018

Ha, time between me reporting this and the fix landing in master, I think it was about a minute. Funny coincidence that it was being fixed as part of #25544. Thanks @rsc and @oiooj.

golang/vgo@c4312af

@pwaller pwaller closed this as completed May 25, 2018
@pwaller
Copy link
Contributor Author

pwaller commented May 25, 2018

I take it back, I'm still hitting this even after golang/vgo@c4312af.

Here's a SIGQUIT sent whilst it was hung during a go install:

Click to expand SIGQUIT stacktrace
goroutine 1 [chan receive]:
os/exec.(*Cmd).Wait(0xc4202602c0, 0x0, 0x0)
	/usr/local/go/src/os/exec/exec.go:469 +0x11f
os/exec.(*Cmd).Run(0xc4202602c0, 0x3, 0xc420221110)
	/usr/local/go/src/os/exec/exec.go:305 +0x5c
golang.org/x/vgo/vendor/cmd/go/internal/modfetch/codehost.Run(0x0, 0x0, 0xc4201f41d8, 0x4, 0x4, 0x10000c4201f4178, 0x0, 0x40, 0xc4202720c0, 0x0)
	/home/pwaller/.local/src/golang.org/x/vgo/vendor/cmd/go/internal/modfetch/codehost/codehost.go:172 +0x1a3
golang.org/x/vgo/vendor/cmd/go/internal/modfetch/gitrepo.(*repo).loadRefs(0xc42027a060)
	/home/pwaller/.local/src/golang.org/x/vgo/vendor/cmd/go/internal/modfetch/gitrepo/fetch.go:99 +0xfe
golang.org/x/vgo/vendor/cmd/go/internal/modfetch/gitrepo.(*repo).(golang.org/x/vgo/vendor/cmd/go/internal/modfetch/gitrepo.loadRefs)-fm()
	/home/pwaller/.local/src/golang.org/x/vgo/vendor/cmd/go/internal/modfetch/gitrepo/fetch.go:124 +0x2a
sync.(*Once).Do(0xc42027a09c, 0xc4201f4528)
	/usr/local/go/src/sync/once.go:44 +0xbe
golang.org/x/vgo/vendor/cmd/go/internal/modfetch/gitrepo.(*repo).statOrArchive(0xc42027a060, 0xc42021e270, 0x6, 0xc420218550, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, ...)
	/home/pwaller/.local/src/golang.org/x/vgo/vendor/cmd/go/internal/modfetch/gitrepo/fetch.go:184 +0x6d
golang.org/x/vgo/vendor/cmd/go/internal/modfetch/gitrepo.(*repo).Stat(0xc42027a060, 0xc42021e270, 0x6, 0xc42021e270, 0x6, 0x0)
	/home/pwaller/.local/src/golang.org/x/vgo/vendor/cmd/go/internal/modfetch/gitrepo/fetch.go:338 +0x95
golang.org/x/vgo/vendor/cmd/go/internal/modfetch.(*codeRepo).Stat(0xc42022e200, 0xc42021e270, 0x6, 0x6, 0x0, 0x0)
	/home/pwaller/.local/src/golang.org/x/vgo/vendor/cmd/go/internal/modfetch/coderepo.go:130 +0xd1
golang.org/x/vgo/vendor/cmd/go/internal/modfetch.Query(0xc42022c240, 0x17, 0xc42021e270, 0x6, 0x0, 0x0, 0x1, 0xc4201f4d00)
	/home/pwaller/.local/src/golang.org/x/vgo/vendor/cmd/go/internal/modfetch/query.go:39 +0x9ff
golang.org/x/vgo/vendor/cmd/go/internal/vgo.fixVersion(0xc42022c240, 0x17, 0xc42021e270, 0x6, 0x0, 0x4122a8, 0x17, 0x17)
	/home/pwaller/.local/src/golang.org/x/vgo/vendor/cmd/go/internal/vgo/init.go:375 +0x100
golang.org/x/vgo/vendor/cmd/go/internal/modfile.parseVersion(0xc42022c240, 0x17, 0xc42021a3b0, 0x93f100, 0x0, 0x0, 0x0, 0x0)
	/home/pwaller/.local/src/golang.org/x/vgo/vendor/cmd/go/internal/modfile/rule.go:298 +0x15e
golang.org/x/vgo/vendor/cmd/go/internal/modfile.(*File).add(0xc42027a000, 0xc4202740e0, 0xc4202782d0, 0xc42021e240, 0x7, 0xc42021a3a0, 0x2, 0x2, 0x93f100)
	/home/pwaller/.local/src/golang.org/x/vgo/vendor/cmd/go/internal/modfile/rule.go:161 +0x659
golang.org/x/vgo/vendor/cmd/go/internal/modfile.Parse(0xc4202221e0, 0x2d, 0xc420276000, 0x55d, 0x75d, 0x93f100, 0x0, 0x26, 0x26)
	/home/pwaller/.local/src/golang.org/x/vgo/vendor/cmd/go/internal/modfile/rule.go:107 +0x167
golang.org/x/vgo/vendor/cmd/go/internal/vgo.InitMod()
	/home/pwaller/.local/src/golang.org/x/vgo/vendor/cmd/go/internal/vgo/init.go:129 +0x34f
golang.org/x/vgo/vendor/cmd/go/internal/vgo.ImportPaths(0xc4200c0070, 0x1, 0x1, 0xc420218300, 0x1, 0x1)
	/home/pwaller/.local/src/golang.org/x/vgo/vendor/cmd/go/internal/vgo/load.go:69 +0x38
golang.org/x/vgo/vendor/cmd/go/internal/load.ImportPaths(0xc4200c0070, 0x1, 0x1, 0x412200, 0x40, 0x8b9b40)
	/home/pwaller/.local/src/golang.org/x/vgo/vendor/cmd/go/internal/load/pkg.go:1485 +0x4f
golang.org/x/vgo/vendor/cmd/go/internal/load.PackagesAndErrors(0xc4200c0070, 0x1, 0x1, 0x20, 0x0, 0xc420000100)
	/home/pwaller/.local/src/golang.org/x/vgo/vendor/cmd/go/internal/load/pkg.go:1457 +0xac
golang.org/x/vgo/vendor/cmd/go/internal/load.PackagesForBuild(0xc4200c0070, 0x1, 0x1, 0xb, 0x7fffcba85d9e, 0x7fd20815b000)
	/home/pwaller/.local/src/golang.org/x/vgo/vendor/cmd/go/internal/load/pkg.go:1499 +0x5d
golang.org/x/vgo/vendor/cmd/go/internal/work.InstallPackages(0xc4200c0070, 0x1, 0x1, 0x0)
	/home/pwaller/.local/src/golang.org/x/vgo/vendor/cmd/go/internal/work/build.go:441 +0x84
golang.org/x/vgo/vendor/cmd/go/internal/work.runInstall(0xb919c0, 0xc4200c0070, 0x1, 0x1)
	/home/pwaller/.local/src/golang.org/x/vgo/vendor/cmd/go/internal/work/build.go:433 +0x49
golang.org/x/vgo/vendor/cmd/go.Main()
	/home/pwaller/.local/src/golang.org/x/vgo/vendor/cmd/go/main.go:155 +0x82e
main.main()
	/home/pwaller/.local/src/golang.org/x/vgo/main.go:31 +0x20

@pwaller pwaller reopened this May 25, 2018
@gopherbot
Copy link

Change https://golang.org/cl/116757 mentions this issue: cmd/go/internal/vgo: disable Git ssh problems for all commands

@golang golang locked and limited conversation to collaborators Jun 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants