divan / gotrace

Concurrency tracer and visualizer for Go (Golang) programming language
MIT License
1.97k stars 128 forks source link

Not a trace file error #20

Open jeffreyyong opened 6 years ago

jeffreyyong commented 6 years ago

Hi,

I followed the steps as mentioned in the README, I got no errors at all when doing the instructions for docker pull and docker run. I can see the binary file and the trace.out file. However, when I run the gotrace ./trace.out ./binary command, this error: panic: not a trace file goroutine 1 [running]: main.main() /Users/jeffreyyong/go/src/github.com/divan/gotrace/main.go:39 +0x3d2 occurred. It's strange, because I'm supposed to build /src/examples/hello.go but the error occurs in main.go

I am running it on MacOs. I am wondering if I have to set other environment variable like GOARCH when doing docker run?

Regards, Jeffrey

Swoboderz commented 6 years ago

i have the same issue. tried installing the patch and that isnt workin either. had to fine the ./gotrace executable and even then i couldnt get it to work

kerak19 commented 6 years ago

Also got this.

image

cuongta commented 6 years ago

Got the same error panic: not a trace file. Here's the stack. Thanks

panic: not a trace file

goroutine 1 [running]:
main.main()
    ~/go/src/github.com/divan/gotrace/main.go:39 +0x381
DavyJ0nes commented 6 years ago

I was able to get this to work using the go18 branch and running Go 1.8 with Docker. It's not ideal but does allow you to play with the visualiser. Below is the steps I went through:

  1. Get gotrace and checkout go18 branch:
    1. go get -u github.com/divan/gotrace
    2. cd $GOPATH/src/github.com/divan/gotrace && git checkout go18
  2. Install gotrace using go 1.8
    1. docker run -v $GOPATH:/go -w /go/src/github.com/divan/gotrace golang:1.8 go install
  3. Run example from Docker:
    1. docker run -p 2000:2000 -v $GOPATH:/go -v $PWD:/go/src/app -w /go/src/app golang:1.8 gotrace examples/pingpong02.go

Hope it helps

shunmian commented 6 years ago

Hey @DavyJ0nes , thanks for your suggestions! I followed your instructions and it works! The only issue is that I find the animation lacks arrow between the gorutines as below. Did you encounter the same issue?

divan commented 5 years ago

Hey, sorry for the unforgivably long response. I stuck in writing patch for Go 1.9-1.11 and I didn't have enough time to devote to this. I think I'll resume working on gotrace next month, so hopefully, that will be resolved. So far, it doesn't produce correct trace for latest Go. There is a go1.11 branch, but it's not ready yet. Thank you for the patience!

NewbMiao commented 4 years ago

Try this Dockerfile , will be more easy to use gotrace compiled by go1.8.

# build locally and run
docker build . -t  divan/golang:gotrace1.8
docker run --rm -it -p 2000:2000  -v $PWD:/go divan/golang:gotrace1.8  examples/hello.go