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: TestScript/get_brace: path "$WORK/tmp/ssh-wwIxCtBYvdEE/agent.13077" too long for Unix domain socket #43635

pborman opened this issue Jan 12, 2021 · 4 comments
NeedsInvestigation Testing


Copy link

@pborman pborman commented Jan 12, 2021

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

$ go version
go version devel +759309029f Mon Jan 11 19:45:02 2021 +0000 darwin/arm64

Does this issue reproduce with the latest release?


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

Mac mini (M1, 2020)
Chip Apple M1
Memory 8GB
go env Output
$ go env

What did you do?

Pulled latest version of go and built using ./all.bash on an Apple Silicon Mac mini

What did you expect to see?

Installed Go for darwin/arm64 in /usr/local/go
Installed commands in /usr/local/go/bin

What did you see instead?

go test proxy running at GOPROXY=
--- FAIL: TestScript (0.01s)
    --- FAIL: TestScript/get_brace (0.05s)
            # Set up some empty repositories. (0.043s)
            > cd $WORK/_origin/foo
            > exec git init
            unix_listener: path "$WORK/tmp/ssh-UAy2f7A6xFNs/agent.53483" too long for Unix domain socket
            [exit status 1]
            FAIL: testdata/script/get_brace.txt:7: unexpected command failure

go tool dist: Failed: exit status 1

The path being used is 138 bytes long:


From the UNIX(4) manual page on MacOS says:

UNIX-domain addresses are variable-length filesystem pathnames of at most 104 characters.

On Linux the same manual page says:

The sun_family field always contains AF_UNIX. On Linux sun_path is 108 bytes in size; see also NOTES, below.

The value of TMPDIR is /var/folders/nv/mw87lzt57nbbmpnpv5rvchj40000gn/T. The part that Go is adding is 90 bytes long.

Building using the following:

$ TMPDIR=/tmp ./all.bash

Does work.

This test's multiple levels of unique temporary directories seems a bit excessive.

@ianlancetaylor ianlancetaylor changed the title unix_listener: path "$WORK/tmp/ssh-wwIxCtBYvdEE/agent.13077" too long for Unix domain socket cmd/go: TestScript/get_brace: path "$WORK/tmp/ssh-wwIxCtBYvdEE/agent.13077" too long for Unix domain socket Jan 12, 2021
Copy link

@ianlancetaylor ianlancetaylor commented Jan 12, 2021

CC @bcmills @jayconrod

@ianlancetaylor ianlancetaylor added the NeedsInvestigation label Jan 12, 2021
@ianlancetaylor ianlancetaylor added this to the Go1.16 milestone Jan 12, 2021
Copy link

@jayconrod jayconrod commented Jan 12, 2021

Couldn't reproduce on darwin/arm64 or amd64. It doesn't look like it's happening in CI either. But the cause seems straightforward, and we could shorten the TMPDIR set in those tests.

cc @matloob

@jayconrod jayconrod removed this from the Go1.16 milestone Jan 12, 2021
@jayconrod jayconrod added this to the Backlog milestone Jan 12, 2021
@jayconrod jayconrod added the Testing label Jan 12, 2021
Copy link
Contributor Author

@pborman pborman commented Jan 12, 2021

Have you tried it on MacOS directly? Did. you examine what your TMPDIR variable was set to? MacOS sets this variable apparently as part of its login process. I have verified this with a new account on MacOS. This is not new in MacOS 11, this also gets set on MacOS 10.15 (I checked) and as far back as I remember. I assume it will be reproducible on Intel Macs as well. This issue is new for Go, however. I built a Go toolchain when I first got my Mac mini and did not have this issue.

Note that the Go appended part is within 14 bytes of being too long itself. Setting TMPDIR to /tmp is a good initial fix but eventually it should be looked into if you really need 3 additional levels of tmp directories or not.

Anyhow, thank you for looking into it and that you will take action so I don't have to remember to set it each time :-)

Copy link

@bcmills bcmills commented Jun 23, 2021

Shorter temp directories would probably also help with #46692.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
NeedsInvestigation Testing
None yet

No branches or pull requests

4 participants