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

pwaller opened this issue May 25, 2018 · 3 comments


Copy link

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://"]
        insteadOf =

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


This comment has been minimized.

Copy link
Contributor Author

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.


@pwaller pwaller closed this May 25, 2018


This comment has been minimized.

Copy link
Contributor Author

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, 0x0, 0xc4201f41d8, 0x4, 0x4, 0x10000c4201f4178, 0x0, 0x40, 0xc4202720c0, 0x0)
	/home/pwaller/.local/src/ +0x1a3*repo).loadRefs(0xc42027a060)
	/home/pwaller/.local/src/ +0xfe*repo).(
	/home/pwaller/.local/src/ +0x2a
sync.(*Once).Do(0xc42027a09c, 0xc4201f4528)
	/usr/local/go/src/sync/once.go:44 +0xbe*repo).statOrArchive(0xc42027a060, 0xc42021e270, 0x6, 0xc420218550, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, ...)
	/home/pwaller/.local/src/ +0x6d*repo).Stat(0xc42027a060, 0xc42021e270, 0x6, 0xc42021e270, 0x6, 0x0)
	/home/pwaller/.local/src/ +0x95*codeRepo).Stat(0xc42022e200, 0xc42021e270, 0x6, 0x6, 0x0, 0x0)
	/home/pwaller/.local/src/ +0xd1, 0x17, 0xc42021e270, 0x6, 0x0, 0x0, 0x1, 0xc4201f4d00)
	/home/pwaller/.local/src/ +0x9ff, 0x17, 0xc42021e270, 0x6, 0x0, 0x4122a8, 0x17, 0x17)
	/home/pwaller/.local/src/ +0x100, 0x17, 0xc42021a3b0, 0x93f100, 0x0, 0x0, 0x0, 0x0)
	/home/pwaller/.local/src/ +0x15e*File).add(0xc42027a000, 0xc4202740e0, 0xc4202782d0, 0xc42021e240, 0x7, 0xc42021a3a0, 0x2, 0x2, 0x93f100)
	/home/pwaller/.local/src/ +0x659, 0x2d, 0xc420276000, 0x55d, 0x75d, 0x93f100, 0x0, 0x26, 0x26)
	/home/pwaller/.local/src/ +0x167
	/home/pwaller/.local/src/ +0x34f, 0x1, 0x1, 0xc420218300, 0x1, 0x1)
	/home/pwaller/.local/src/ +0x38, 0x1, 0x1, 0x412200, 0x40, 0x8b9b40)
	/home/pwaller/.local/src/ +0x4f, 0x1, 0x1, 0x20, 0x0, 0xc420000100)
	/home/pwaller/.local/src/ +0xac, 0x1, 0x1, 0xb, 0x7fffcba85d9e, 0x7fd20815b000)
	/home/pwaller/.local/src/ +0x5d, 0x1, 0x1, 0x0)
	/home/pwaller/.local/src/ +0x84, 0xc4200c0070, 0x1, 0x1)
	/home/pwaller/.local/src/ +0x49
	/home/pwaller/.local/src/ +0x82e
	/home/pwaller/.local/src/ +0x20

@pwaller pwaller reopened this May 25, 2018


This comment has been minimized.

Copy link

commented Jun 6, 2018

Change 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.
None yet
2 participants
You can’t perform that action at this time.