-
Notifications
You must be signed in to change notification settings - Fork 0
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
GTIRB frontend produces GoTos between procedures #271
Comments
I can't even get this binary to lift with gtirb-semantics, even after updating my installation of it and ddisasm? What version of each are you using? I get the following from gtirb-semantics:
ddisasm gives these warnings too, but it produces a .gtirb file successfully:
|
Without having the input to examine it's hard to say what the issue is, but it could very well be a bug in ddisasm's function bounds identification. Can you share the .json output just for the close_file subroutine? That should be enough to figure out what's going on. |
Sorry, I forgot to mention it will require the fixes to gtirb_semantics that aren't merged yet.
This commit should work as is, the PR branch will require a small change to the basil frontend to handle the error json format for unsupported instructions. UQ-PAC/gtirb-semantics@9ff14e9
I'm on leave now so don't have access to my computer with the lifted files. It might be easier to wait until I'm back and can merge and update the nix package.
|
If you're on leave then you don't need to respond to this until you're back, it's fine. Looking at the assembly, there's an indirect call in close_file that uses The indirect call appears to be to a function pointer contained within a struct that's passed by reference to close_file, so it's not easy to tell where it can point - if ddisasm has managed resolved it to a single location then that's somewhat surprising. |
The json for that procedure is here: https://gist.github.com/ailrst/0178f78739fe18aed99e445f1b16b2a4#file-close_file-txt-L235
I'm not sure what you mean by 'implemented properly'; purely recognising them in the loader? The absence of a return edge should indicate it is a non-returning call, if the jump targets a procedure header (which it should?) then we can just convert it to |
Non-returning control flow is not really handled properly at present because non-returning calls do usually return somewhere, just indirectly, and we do not currently account for this. This happens in this case (though it's a relatively complex one). Here, |
In the attached example, when lifted with ddisasm and gtirb_semantics it produces a goto in close_file that targets a block in __stdio_seek.
gate_server.tar.gz
This property is checked with the following code: https://gist.github.com/ailrst/847a9aecc909a47b05c8634c5aa8070a. This is checked in to the simplification-pass branch/pr.
The text was updated successfully, but these errors were encountered: