Skip to content

runtime/pprof: remove "(deleted)" from binary filename #25740

@mkevac

Description

@mkevac

What version of Go are you using (go version)?

2c01b7d

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

4.15.0-22-generic
Ubuntu 18.04 LTS

What did you do?

Run a service with "net/http/pprof" and tried using pprof (https://github.com/google/pprof/) to profile this service.
As I said in google/pprof#386, this is what I got:

$ pprof -http=:8080 foobar.lan:31571/debug/pprof/profile?seconds=5
Fetching profile over HTTP from http://foobar.lan:31571/debug/pprof/profile?seconds=5
Local symbolization failed for foobar-3.61.0-4290 (deleted): stat /local/foobar/bin/foobar-3.61.0-4290 (deleted): no such file or directory
Some binary filenames not available. Symbolization may be incomplete.
Try setting PPROF_BINARY_PATH to the search path for local binaries.
Saved profile in /home/marko/pprof/pprof.foobar-3.61.0-4290 (deleted).samples.cpu.002.pb.gz

Notice "(deleted)" in binary name and in profile name.
This is because binary for a running service was rewritten (deleted, moved, does not matter) and /proc/pid/maps gives you name of the binary with string "(deleted)" appended to tell you that the file was removed (inode is different or unexisting).

I propose for runtime/pprof to cleanup filename and remove "(deleted)" if it exists.
It is not needed and it would be easier to put the same file locally and get symbols and source code.

Initially I've opened an issue for pprof (google/pprof#386), but they've decided that it would be better to fix it in Go.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions