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

os/exec: Failure in Cmd.Start() can orphan descriptors #3468

Closed
gopherbot opened this issue Apr 4, 2012 · 2 comments
Closed

os/exec: Failure in Cmd.Start() can orphan descriptors #3468

gopherbot opened this issue Apr 4, 2012 · 2 comments

Comments

@gopherbot
Copy link

by briandellisanti:

Inspection of os/exec.Cmd.Start() shows that it will orphan descriptors created
internally if it fails to complete successfully. Finalization will close the descriptors
eventually, but it would be better if they were closed immediately.

Specifically, if os.StartProcess() or the setupFd methods return errors, Start() bails
out immediately.
@dsymonds
Copy link
Contributor

dsymonds commented Apr 4, 2012

Comment 1:

Labels changed: added priority-later, packagebug, removed priority-triage.

Owner changed to @bradfitz.

@ianlancetaylor
Copy link
Contributor

Comment 2:

This issue was closed by revision a0f7c6c.

Status changed to Fixed.

ianlancetaylor pushed a commit that referenced this issue May 11, 2015
….Start() fails.

««« backport 9d046474e95a
os/exec: close all internal descriptors when Cmd.Start() fails.

This closes any internal descriptors (pipes, etc) that Cmd.Start() had
opened before it failed.

Fixes #3468.

R=golang-dev, iant, bradfitz
CC=golang-dev
https://golang.org/cl/5986044

»»»
@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.
Projects
None yet
Development

No branches or pull requests

4 participants