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: go run leaves directories behind in /tmp #3572

Closed
wathiede opened this issue Apr 28, 2012 · 11 comments
Closed

cmd/go: go run leaves directories behind in /tmp #3572

wathiede opened this issue Apr 28, 2012 · 11 comments
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@wathiede
Copy link
Member

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
0. $ ls -d /tmp/go-build*|wc -l
ls: /tmp/go-build*: No such file or directory
       0

1. go run www.go # See bottom of bug for source
2. Hit ctrl-c
3. $ ls -d /tmp/go-build*|wc -l
       1

What is the expected output?
I would expect files to be cleaned up on exit.

What do you see instead?
A go-build directory per 'go run' invocation

Which compiler are you using (5g, 6g, 8g, gccgo)?
I'm using a 64-bit build, so I assume 8g

Which operating system are you using?
FreeBSD 8.2

Which version are you using?  (run 'go version')
go version go1

built from source:
$ hg sum
parent: 12872:920e9d1ffd1f go1 release
 go1
branch: release-branch.go1
commit: (clean)
update: (current)

Please provide any additional information below.
// www.go

package main

import (
        "fmt"
        "log"
        "net/http"
)

func main() {
        http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
                fmt.Fprintf(w, "Hello")
        })

        log.Fatal(http.ListenAndServe(":8080", nil))
}
@robpike
Copy link
Contributor

robpike commented Apr 28, 2012

Comment 1:

Too bad there's no portable remove-on-close capability.

Labels changed: added priority-soon, removed priority-triage.

Owner changed to @rsc.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Sep 12, 2012

Comment 2:

Presumably go run should ignore the signal, wait for the child to exit, and clean up.
See also issue #3581.

@rsc
Copy link
Contributor

rsc commented Sep 12, 2012

Comment 3:

Labels changed: added go1.1.

@gopherbot
Copy link

Comment 4 by david.dobronszki:

The same can be experienced on Windows 7 too.

@alexbrainman
Copy link
Member

Comment 5:

@rsc, the intention of ctrl-c is "I want this program to be stopped now". So, I think,
ignoring the signal is not acceptable. Perhaps we could intercept ctrl+c and send it to
the child process instead, and then wait for it to finish. Not sure about unix, but
windows version, probably, should start child process in a new process group, like we
already do in one of our tests in os/signal.
Alex

@alexbrainman
Copy link
Member

Comment 6:

https://golang.org/cl/6903061/

Status changed to Started.

@rsc
Copy link
Contributor

rsc commented Dec 10, 2012

Comment 7:

Labels changed: added size-m.

@rsc
Copy link
Contributor

rsc commented Dec 10, 2012

Comment 8:

Labels changed: added suggested.

@rsc
Copy link
Contributor

rsc commented Dec 10, 2012

Comment 9:

Owner changed to @alexbrainman.

@alexbrainman
Copy link
Member

Comment 10:

Russ, do you agree with Dave's suggestion https://golang.org/cl/6903061/#msg6 ?
Or should I leave out changes to "go test" altogether?
Alex

@alexbrainman
Copy link
Member

Comment 11:

This issue was closed by revision 04f0d14.

Status changed to Fixed.

@wathiede wathiede added fixed Suggested Issues that may be good for new contributors looking for work to do. labels Dec 14, 2012
@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

No branches or pull requests

5 participants