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

Closed
pborman opened this issue Jan 12, 2021 · 6 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Testing An issue that has been verified to require only test changes, not just a test failure. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@pborman
Copy link
Contributor

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?

Yes.

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
GOARCH="arm64"
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOOS="darwin"

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?

ALL TESTS PASSED
---
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=http://127.0.0.1:52360/mod
--- FAIL: TestScript (0.01s)
    --- FAIL: TestScript/get_brace (0.05s)
        script_test.go:213: 
            # Set up some empty repositories. (0.043s)
            > cd $WORK/_origin/foo
            $WORK/_origin/foo
            > exec git init
            [stderr]
            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
...

FAIL
go tool dist: Failed: exit status 1

The path being used is 138 bytes long:

/var/folders/nv/mw87lzt57nbbmpnpv5rvchj40000gn/T/cmd-go-test-2243202799/tmpdir3895905378/script-get_brace/tmp/ssh-UAy2f7A6xFNs/agent.53483

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
@ianlancetaylor
Copy link
Contributor

CC @bcmills @jayconrod

@ianlancetaylor ianlancetaylor added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jan 12, 2021
@ianlancetaylor ianlancetaylor added this to the Go1.16 milestone Jan 12, 2021
@jayconrod
Copy link
Contributor

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 modified the milestones: Go1.16, Backlog Jan 12, 2021
@jayconrod jayconrod added the Testing An issue that has been verified to require only test changes, not just a test failure. label Jan 12, 2021
@pborman
Copy link
Contributor Author

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 :-)

@bcmills
Copy link
Contributor

bcmills commented Jun 23, 2021

Shorter temp directories would probably also help with #46692.

@bcmills
Copy link
Contributor

bcmills commented Aug 25, 2022

@pborman, it isn't clear to me why git init in that test would be trying to create a Unix domain socket in the first place. From what I understand it mainly uses Unix domain sockets to communicate with credential helpers, but the script test shouldn't be using a credential helper (because its configuration should be isolated from the user's configuration).

Any idea where it might be picking that up?

@bcmills bcmills added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Aug 25, 2022
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators Sep 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Testing An issue that has been verified to require only test changes, not just a test failure. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

5 participants