Skip to content

cmd/pprof: handle "pprof in use" graciously #3680

@hanwen

Description

@hanwen
Thanks.

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. use runtime/pprof and http/pprof simultaneously
2. go tool pprof DEBUG-URL
3. this yields:

Read http://localhost:50556/debug/pprof/symbol
Gathering CPU profile from http://localhost:50556/debug/pprof/profile?seconds=30 for 30
seconds to
  /home/hanwen/pprof/worker.1338264155.localhost-port50556
Be patient...
Wrote profile to /home/hanwen/pprof/worker.1338264155.localhost-port50556
substr outside of string at /home/hanwen/vc/go/pkg/tool/linux_386/pprof line 3299,
<PROFILE> line 1.
Use of uninitialized value in string eq at /home/hanwen/vc/go/pkg/tool/linux_386/pprof
line 3299, <PROFILE> line 1.
substr outside of string at /home/hanwen/vc/go/pkg/tool/linux_386/pprof line 3301,
<PROFILE> line 1.
Use of uninitialized value in string eq at /home/hanwen/vc/go/pkg/tool/linux_386/pprof
line 3301, <PROFILE> line 1.
/home/hanwen/pprof/worker.1338264155.localhost-port50556: header size >= 2**16
go tool pprof: exit status 1


The profile file itself contains:

"Could not enable CPU profiling: cpu profiling already in use"

What is the expected output?

a sensible error message 

this is on

8g, Linux, 

$ go tool 8g -V
8g version weekly.2012-03-27 +ac7250065a04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions