Skip to content

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

@sandlerben

Description

@sandlerben

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions