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

could not generate data files #11

Open
ldez opened this issue Jul 26, 2023 · 7 comments
Open

could not generate data files #11

ldez opened this issue Jul 26, 2023 · 7 comments

Comments

@ldez
Copy link
Contributor

ldez commented Jul 26, 2023

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)
$ 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
Copy link
Owner

knz commented Jun 4, 2024

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

@knz knz closed this as completed Jun 4, 2024
@ldez
Copy link
Contributor Author

ldez commented Jun 4, 2024

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 knz reopened this Jun 4, 2024
@knz
Copy link
Owner

knz commented Jun 4, 2024

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

@ldez
Copy link
Contributor Author

ldez commented Jun 4, 2024

from my memories, it's for any binaries.

@Zxilly
Copy link

Zxilly commented Jul 10, 2024

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
Copy link
Owner

knz commented Jul 10, 2024

@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
Copy link

Zxilly commented Jul 10, 2024

Yes, it can load these info from dwarf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants