GrammaTech / ddisasm

A fast and accurate disassembler
https://grammatech.github.io/ddisasm/
GNU Affero General Public License v3.0
647 stars 59 forks source link

vim fails disassembly #21

Closed jrmuizel closed 3 years ago

jrmuizel commented 3 years ago

vim compiled with gcc-7.5.0 fails with:

Printing assembler ddisasm: /root/gtirb-pprinter/src/gtirb_pprinter/ElfPrettyPrinter.cpp:195: void gtirb_pprint::ElfPrettyPrinter::printSymbolHeader(std::ostream&, const gtirb::Symbol&, bool): Assertion `!"unknown visibility in elfSymbolInfo!"' failed.

This is with ddisasm 1.4 (1cbb62cb91f4a51b615e0150ebb25fc97dcef640)

I've attached the binary vim.zip

I ran into this while trying out ddisasm on https://github.com/pangine/disasm-benchmark

aeflores commented 3 years ago

Hi @jrmuizel thanks for reporting! we will look into this and the other issues. I would be curious to know the results of that evaluation overall if you have them available

jrmuizel commented 3 years ago

I don't have overall results. I filed https://github.com/pangine/disasm-benchmark/issues/1 and sounds like the authors tried to get results but there were too many failures.

junghee commented 3 years ago

We were able to reproduce the failure with the commit hash of ddisasm. I used an older version of gtirb-pprinter because the related commit hash was not reported.

We confirmed that vim builds OK with the latest versions of ddisasm + gtirb-pprinter. Here are the commit hashs:

ddisasm: 1cbb62cb91f4a51b615e0150ebb25fc97dcef640

gtirb-pprinter: 370eebc7ed61eaf0a721e0bd441d67e2c8024319


Once I commented, I realized the ddisasm versions are the same. It seems that using an older version of gtirb-pprinter was the problem.

jrmuizel commented 3 years ago

I was using gtirb-pprinter: f6e382346171dc2e3a3ba16948f83cda13e1242c

jrmuizel commented 3 years ago

I see the same thing with 370eebc7ed61eaf0a721e0bd441d67e2c8024319. Maybe the problem is the version of LIEF? I'm using LIEF-0.10.1

junghee commented 3 years ago

I was using LIEF-0.10.0, but I don't really think it's a LIEF problem. Did you remove your build directory and try a clean rebuild?

jrmuizel commented 3 years ago

I still see the problem with a clean no-cache build of this docker file: https://github.com/jrmuizel/disasm-eval-disasms/blob/main/dockerfiles/Dockerfile.ddisasm2

junghee commented 3 years ago

I'm not sure why I was not able to reproduce it earlier, but I tried the setup in your Dockerfile from scratch, and reproduced the failure. A fix has been merged to the gtirb-pprinter master. Hope it works on your end as well.

jrmuizel commented 3 years ago

I can still reproduce this with a fresh rebuild of https://github.com/jrmuizel/disasm-eval-disasms/blob/main/dockerfiles/Dockerfile.ddisasm2 (which has been updated to use gtirb-pprinter a974d7a43a1b51c15793a6322c75c8065f8f4d8d)

junghee commented 3 years ago

That one seems older than my fix. Sorry, I should have specified the hash number earlier. The hash for the fix is 913269153e66fd133a80f92ef66ad4e2cf72ab54.

jrmuizel commented 3 years ago

That hash doesn't exist in the in the gtirb-pprinter repository: https://github.com/GrammaTech/gtirb-pprinter/commit/913269153e66fd133a80f92ef66ad4e2cf72ab54

aeflores commented 3 years ago

Oh, it looks like we have an issue with the updates to the public repo. I'll look into it!

jrmuizel commented 3 years ago

That fixed it. Thanks.