-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/link: does not clean up host link inputs #24704
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
Comments
The relevant code is in src/cmd/link/internal/ld/lib.go's hostlinksetup, which does AtExit(rmtemp), and rmtemp in turn does os.RemoveAll of the temp dir. The next step is to find out why RemoveAll is not removing all. Probably Windows thinks some process still has go.o open and refuses to remove it. I hope that process is cmd/link - that is, I hope we just forgot to close the file - because that would be an easy fix. |
@ncw my favorite type of bug, thank you. :-) I will try to debug this when I have time. Alex |
Change https://golang.org/cl/113935 mentions this issue: |
The new test added here fails on linux/ppc64 (works fine on linux/ppc64le) since full linker support was never added for linux/ppc64 and cgo doesn't work there. The test should be skipped for linux/ppc64. |
Thanks for fixing this @alexbrainman - you are the windows wizard :-) |
This is fixed by CL 114235 now. Sorry for breaking it, but there are no try-bots configured as no-cgo. Alex |
What version of Go are you using (
go version
)?go version go1.10.1 windows/amd64
Does this issue reproduce with the latest release?
Yes. Haven't tried tip.
What operating system and processor architecture are you using (
go env
)?I'm running this on Windows 2016 Server, but I've see the same issue on Windows 7 too.
What did you do?
Compile this very simple cgo program - a directory called
go-link-XXXXX
is left behind in %TEMP%.Programs which do not use cgo leave nothing behind in %TEMP%.
What did you expect to see?
I expected go to clean up after itself.
What did you see instead?
A left over directory in %TEMP%. Inside it is a single file
I noticed this because I left my machine running
go test
in a loop overnight and it filled the disk up!The text was updated successfully, but these errors were encountered: