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/pprof: should exit with nonzero status codes on errors #11510

Closed
sandlerben opened this issue Jul 2, 2015 · 1 comment
Closed

cmd/pprof: should exit with nonzero status codes on errors #11510

sandlerben opened this issue Jul 2, 2015 · 1 comment
Milestone

Comments

@sandlerben
Copy link

When go tool pprof encounters an error, it writes to STDERR but still exits with a 0 status code. This means that Go's own exec package does not detect errors from the "go tool pprof" command.

Here is some code that produces the issue.

cmd := exec.Command("go", "tool", "pprof", "http://thiswillcauseanerror.com")
out, err := cmd.Output() // error is nil!

For now, I am checking if anything is written to STDERR as a workaround.

@bradfitz bradfitz added this to the Go1.5Maybe milestone Jul 2, 2015
@bradfitz bradfitz changed the title go tool pprof (cmd/pprof) should exit with nonzero status codes on errors cmd/pprof: should exit with nonzero status codes on errors Jul 2, 2015
@rsc rsc modified the milestones: Go1.6, Go1.5Maybe Jul 20, 2015
@gopherbot
Copy link
Contributor

CL https://golang.org/cl/16718 mentions this issue.

@rsc rsc closed this as completed in 08ab43e Dec 5, 2015
@golang golang locked and limited conversation to collaborators Dec 14, 2016
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