autopprof icon indicating copy to clipboard operation
autopprof copied to clipboard

Cannot start pprof UI: exit status 1

Open lnquy opened this issue 6 years ago • 3 comments

Hi, Thanks for really helpful project. I tested autopprof on Ubuntu 18.04.1 LTS with go 1.10.4, but got the error Cannot start pprof UI: exit status 1. I changed your code a little bit to use exec.CombinedOutput() and got this message from stderr: invalid port number: strconv.Atoi: parsing "": invalid syntax. I also tried to run this pprof command go tool pprof -http=: /tmp/profile-673928358 and got the same error so it seems we have to use a specific port for go tool pprof -http rather than just :.

My suggestion is we can just use a fixed port, it should be simple enough. Thanks

lnquy avatar Nov 27 '18 03:11 lnquy

I wanted a random port so you can view multiple profiles. It is weird that ":" is not behaving on Linux. Does escaping works? go tool pprof -http=":"?

I contributed the http flag to pprof and should also fix the behavior there.

rakyll avatar Nov 28 '18 01:11 rakyll

I will get back to this issue when I can ssh into a linux box :)

rakyll avatar Nov 28 '18 04:11 rakyll

I think we can just randomize a port in range 30000-32767 and check if it's in used or not. It's easier than contribute and wait for go tool to update. I can make a PR for this issue if you're ok with my suggestion. Thanks

lnquy avatar Nov 28 '18 09:11 lnquy