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

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

Closed
mkevac opened this issue Jun 5, 2018 · 3 comments
Closed

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

mkevac opened this issue Jun 5, 2018 · 3 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@mkevac
Copy link
Contributor

mkevac commented Jun 5, 2018

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.

@ianlancetaylor ianlancetaylor added the NeedsFix The path to resolution is known, but the work has not been done. label Jun 5, 2018
@ianlancetaylor ianlancetaylor added this to the Go1.12 milestone Jun 5, 2018
@gopherbot
Copy link

Change https://golang.org/cl/116395 mentions this issue: runtime/pprof: remove "deleted" suffix while parsing maps file

@mkevac
Copy link
Contributor Author

mkevac commented Jun 5, 2018

Hey. I've fixed it in https://go-review.googlesource.com/c/go/+/116395
This is my first code contribution to Go. I hope it's fine :-)

@ianlancetaylor
Copy link
Contributor

Thanks for sending the change. We'll take a look when the 1.12 cycle opens (see https://golang.org/wiki/Go-Release-Cycle).

@golang golang locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants