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: some temp dirs not cleaned up #19449
Comments
As of commit a306a85, I don't see the stray go-link-* or gotest* directories. The stray go-build* directory appears to be created by cmd/go/internal/work/build.go's Init() function, but I have not yet tracked down why. There are > 3000 calls to this function, only one of them does this AFAICT (good excuse for me to learn to use a go debugger, I suppose). |
I couldn't figure out a way to get stack traces inside cmd/go/internal/work/build.go (not sure why it's not possible to import runtime/debug there?), but a git bisect run narrowed this down to e9bb9e5. If I remove the TestRespectGroupSticky function that was added by that commit, there are no stray go-build* temp directories left behind. |
@mostynb nice digging! And that points to the solution--looks to me like in moveOrCopyFile, if we choose the copy path, instead of just copying, we need to copy and then unlink the old. |
I'm not familiar with this code (I'm new to go), so I was looking into calling base.Fatalf instead of testing.T.Fatalf inside TestRespectGroupSticky - this seems to work, because the AtExit handling is done by base. But I'm not sure if this breaks the assumptions of the test setup. I will play around with your suggested change to moveOrCopyFile... |
I would hope that none of the Fatalfs are actually being reached. :) But if there's a custom Fatalf present, we should probably use it regardless. But I don't know much about this code. Dig in and figure it out! You have a good start. :) |
CL https://golang.org/cl/40912 mentions this issue. |
Clean your temp dir, run all.bash, and examine your temp dir. There are a few new temp files left not cleaned up. Some are from pprof and will hopefully soon be fixed upstream (google/pprof#108).
I also see these:
I speculate that these are created by the cmd/go tests and/or test dir tests that run with -x, but I haven't investigated.
The text was updated successfully, but these errors were encountered: