-
Notifications
You must be signed in to change notification settings - Fork 13
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
elfx86exts 0.4.3 / capstone 0.7.0 overlooks instructions in some circumstances #66
Comments
Hm, that is a pretty substantial difference in the output! And I presume that we have good reason to believe that the output from the capstone 0.10 series is more accurate. Fortunately the main branch of the repo has already been bumped to capstone 0.10, so all I need to do is issue a new release. I'll do that now — I have some nice release automation so it's easy. |
OK, version 0.5.0 is now released, and should hopefully fix your issue. I'll close this but feel free to comment or file a separate issue if there's more to discuss. |
The binary was compiled for AVX512 and I do notice it requires an absurd amount of memory (42GB of RAM to analyse this 125MB binary), but also that could be related to my .clone() hack? Tried to build v0.5.0 to verify but note it doesn't compile on cargo's stable channel:
If I revert to ¹ as measured by |
That's odd — I'm definitely building this package using stable Rust, and As for the memory consumption, I hope that it's only apparent, and not actually filling up gigabytes of in-memory buffers. But I'm not sure. I am pretty confident, though, that this program is operating sensibly — if the lower-level libraries are allocating huge buffers I'm not sure if we'll be able to do anything about that :-/ |
It's definitely using gigabytes of memory; it sent my workstation (w/ 32GB RAM) into swap every time I tried to run it and I moved to a machine with 128GB RAM to get those timings :) I wonder if the rust version contributes to the resolver issue?
And according to https://doc.rust-lang.org/cargo/reference/resolver.html
I'm on rustc/cargo 1.48.0 so that probably explains it. |
Wow! I wonder where that massive memory allocation is coming from — I can't imagine that it's needed for the kind of analysis this tool is doing. Maybe the default disassembly computes some kind of massive metadata structures, and we can avoid that somehow? To be honest, I don't really use this program anymore and I don't have the bandwidth to dig into its bugs, but I would love for someone to figure out what's going on here! |
Yeah fair enough! I spent 10 minutes looking into capstone before getting dragged into more pressing matters. Thanks for the tool and the object-0.27.1 fix :) |
@pkgw I can confirm that the massive memory allocation is still the case as of the latest release. Analyzing a 123MB binary OOMs my 24GB RAM machine. |
I can confirm that the massive memory allocation is still the case as of the latest master branch. Analyzing a 17MB binary (/bin/supertuxkart) OOMs my 16GB RAM machine. |
I don't use this tool myself anymore and unfortunately I'm not in a position to spend time on it, but maybe the proposal in #47 would help with addressing this. |
Oh, also, the original issue was something different, so I'm opening a new issue for the memory consumption problem. Please continue discussion in #90. |
Basically I have two builds of
elfx86exts
, both of which I'm running against the same large binary (126M). Both builds were created viacargo install elfx86exts
withrust-1.48.0
. The first build is stockelfx86exts-0.4.3
and the second build is one I patched manually to update the capstone dependency to^0.10
(previous build was against thecapstone-0.7.0
crate).The two behave very differently. Here's the stock version:
And here's my manually patched version:
Wildly different runtimes and detected instruction sets. It seems like the stock version is exiting early but it does so silently and without raising any error (exit code is 0).
I had to change two lines to get here; the first was in Cargo.tml:
And the second in src/main.rs:
To satisfy the borrow checker -- I guess the return type of
detail.groups()
has changed upstream but I didn't investigate in detail, just picked up the biggest hammer from my rust beginner's toolkit :)The text was updated successfully, but these errors were encountered: