knz / go-binsize-viz

Size visualization of Go executables using D3
GNU Affero General Public License v3.0
470 stars 30 forks source link

could not generate data files #11

Open ldez opened 1 year ago

ldez commented 1 year ago

Even with changes from #10, I'm not able (without running steps by hand and ignoring errors) to run go-binsize-viz.

I don't know if those errors are expected (I guess not) and should be ignored in the script. Note: I'm on linux/amd64.

$ docker run -v ./dist:/dist -p 8000:8000 knz-go-binsize-viz:temp -b /dist/binary
2023-07-26 14:36:41  using tmpdir /tmp/tmp.MnpHdB
2023-07-26 14:36:41  running go tool on /dist/binary
2023-07-26 14:36:43  status code 1 message: could not generate data files
debug (run step by step and ignore errors) ```console $ docker run --rm -it --entrypoint sh -v ./dist:/dist -p 8000:8000 knz-go-binsize-viz:temp ~ $ tmpdir=$(mktemp -d) ~ $ binary=/dist/binary ~ $ go tool nm -size "${binary}" | c++filt >${tmpdir}/symtab.txt ~ $ python3 ./tab2pydic.py ${tmpdir}/symtab.txt >${tmpdir}/out.py ... unknown T sym format: type:.eq.vendor/golang.org/x/net/idna.labelError unknown T sym format: type:.eq.vendor/golang.org/x/sys/cpu.option unknown T sym format: type:.hash.github.com/sacloud/iaas-api-go/search.FilterKey unknown T sym format: type:.hash.golang.org/x/net/http2/hpack.pairNameValue unknown T sym format: type:.hash.google.golang.org/grpc/resolver.Address unknown T sym format: type:.hash.google.golang.org/protobuf/internal/filedesc.pathKey unknown T sym format: type:.hash.internal/intern.key unknown T sym format: type:.hash.net/http.connectMethodKey unknown T sym format: type:.hash.reflect.visit unknown T sym format: type:.hash.vendor/golang.org/x/net/http2/hpack.pairNameValu ... ~ $ python3 ./simplify.py ${tmpdir}/out.py >${tmpdir}/data.js loading... transforming... output... ~ $ cp -r ./js ${tmpdir}/js ~ $ cp ./app3.js ${tmpdir}/app3.js ~ $ cp ./treemap.css ${tmpdir}/treemap.css ~ $ cp ./treemap_v3.html ${tmpdir}/treemap_v3.html ~ $ cd ${tmpdir} /tmp/tmp.hDimnc $ python3 -m http.server Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ... ```
knz commented 3 months ago

I think you've fixed this in #10? I'm closing this issue, feel free to reopen if relevant.

ldez commented 3 months ago

I cannot reopen an issue you closed.

As I said: Even with changes from #10, I'm not able to run go-binsize-viz

knz commented 3 months ago

Would you be ok sharing some details of the binary that causes trouble? Or is this issue the same for any binary?

ldez commented 3 months ago

from my memories, it's for any binaries.

Zxilly commented 2 months ago

Maybe you can give https://github.com/Zxilly/go-size-analyzer a try. If you find that your binary cannot be analyzed and don't mind making this binary public, please send it to me. I'm collecting weird GoLang binaries for integration testing.

I noticed that you are a maintainer of golangci-lint, here is a basic analysis for golangci-lint 1.59 linux amd64

image

knz commented 2 months ago

@Zxilly thanks for the link. This is a very good piece of software! Can it also analyze objects produced by other languages, present in the symbol table? For example, the script I produced is able to parse entries generated by C/C++ when using CGo. This is useful for programs that include external libraries.

Zxilly commented 2 months ago

Yes, it can load these info from dwarf.