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

Error: java.lang.RuntimeException: Unable to create decompiler #58

Closed
kajaaz opened this issue Nov 27, 2023 · 12 comments · Fixed by #60
Closed

Error: java.lang.RuntimeException: Unable to create decompiler #58

kajaaz opened this issue Nov 27, 2023 · 12 comments · Fixed by #60
Assignees
Labels
bug Something isn't working

Comments

@kajaaz
Copy link

kajaaz commented Nov 27, 2023

Hi,

I have an issue when running GhiHorn on my Ghidra on a Go binary. Could you help me to fix that please ?


ApiAnalyzer Failed (4 errors)
Error: java.lang.RuntimeException: Unable to create decompiler

Build Date: 2023-Jul-11 1640 EDT
Ghidra Version: 10.3.2
Java Home: /home/usr/ghidra/OpenJDK17U-jdk_x64_linux_hotspot_17.0.8_7/jdk-17.0.8+7
JVM Version: Eclipse Adoptium 17.0.8
OS: Linux 6.2.0-37-generic amd64


[2023-11-27 16:55:22]: Looking for path from 00dfdf00 to 00dfe259
[2023-11-27 16:55:22]: Error: java.lang.RuntimeException: Unable to create decompiler
[2023-11-27 16:55:22]: PathAnalyzer completed.
[2023-11-27 16:55:22]: PathAnalyzer completed.
[2023-11-27 16:55:22]: PathAnalyzer completed.
[2023-11-27 17:08:58]: PathAnalyzer completed.
[2023-11-27 17:08:58]: PathAnalyzer completed.
[2023-11-27 17:08:58]: PathAnalyzer completed.
[2023-11-27 17:08:58]: PathAnalyzer completed.
[2023-11-27 17:08:58]: PathAnalyzer completed.
[2023-11-27 17:08:58]: PathAnalyzer completed.
[2023-11-27 17:08:58]: PathAnalyzer completed.
[2023-11-27 17:08:58]: PathAnalyzer completed.


[2023-11-27 17:14:44]: Looking for all API signatures
[2023-11-27 17:14:44]: Error: java.lang.RuntimeException: Unable to create decompiler
[2023-11-27 17:14:45]: Error: java.lang.RuntimeException: Unable to create decompiler
[2023-11-27 17:14:45]: Error: java.lang.RuntimeException: Unable to create decompiler
[2023-11-27 17:14:46]: Error: java.lang.RuntimeException: Unable to create decompiler
[2023-11-27 17:14:46]: Error: java.lang.RuntimeException: Unable to create decompiler
[2023-11-27 17:14:46]: ApiAnalyzer completed.
[2023-11-27 17:14:46]: ApiAnalyzer completed.
[2023-11-27 17:14:46]: ApiAnalyzer completed.
[2023-11-27 17:14:46]: ApiAnalyzer completed.
[2023-11-27 17:14:46]: ApiAnalyzer completed.
[2023-11-27 17:14:46]: Error: java.lang.RuntimeException: Unable to create decompiler


@jeffgennari
Copy link

Hi,

Can you share the binary that caused the exception? We need a bit more information to reproduce this issue.

@kajaaz
Copy link
Author

kajaaz commented Nov 28, 2023

Hi,

Can you share the binary that caused the exception? We need a bit more information to reproduce this issue.

Hi @jeffgennari,

Sure. I work on https://github.com/ethereum/go-ethereum, on the geth binary (from make geth).
Actually I got the same error on different Go binary that are forks of this repo.

This error comes from here I think :

throw new RuntimeException("Unable to create decompiler");

Thank you for your time

@sei-eschwartz
Copy link

sei-eschwartz commented Nov 28, 2023 via email

@kajaaz
Copy link
Author

kajaaz commented Nov 29, 2023

Can you upload the binary? Thanks.

Hi @sei-eschwartz,

Yes, here it is.

@sei-eschwartz sei-eschwartz added the bug Something isn't working label Nov 29, 2023
@sei-eschwartz sei-eschwartz self-assigned this Nov 29, 2023
@sei-eschwartz
Copy link

So this did not work for me either, but it failed in a very different way. I got the following error:

[2023-11-29 15:37:01]: Looking for path from 00dfdf00 to 00dfe259
[2023-11-29 15:46:10]: Error: No entry point found for function: COVER_selectDict.
[2023-11-29 15:46:10]: PathAnalyzer completed.

I think this might be related to #40 and fdc3a80

I'm really not sure why you would be unable to create a decompiler. Does the decompiler GUI work for you? Could you be running out of memory?

@sei-eschwartz
Copy link

sei-eschwartz commented Nov 29, 2023

So I made another patch for the entry point problem: cmu-sei#10

But with that, I get:

[2023-11-29 16:16:03]: Looking for path from 00dfdf00 to 00dfe259
[2023-11-29 16:25:25]: Encountered invalid decompiled function(s), analysis may be inaccurate
[2023-11-29 16:34:37]: Could not complete analysis: Failed to generate variables for p-code at address 015c011b:  ---  STORE (const, 0x1b1, 4) , (register, 0x38, 8) , (const, 0x0, 16), exception: Bit length must be >= 1 and <= 64. This is an issue with Ghidra's HighConstant class.
[2023-11-29 16:34:37]: PathAnalyzer completed.
        015c011b 0f 11 07        MOVUPS     xmmword ptr [RDI],XMM0        

This is a known problem with Ghidra that we don't really have a way to work around at the moment.

@kajaaz
Copy link
Author

kajaaz commented Nov 30, 2023

Hi @sei-eschwartz,

  1. Yes I think my decompiler GUI works properly (see screenshot). I can explore functions and create Graph Control/Data Flow without troubles.

  2. I use additional scripts for Go binaries to decompile, maybe that explains the differences we have.

I still do not understand why I have this issue with "Unable to create decompiler"... :/

ksnip_20231130-100855

@sei-eschwartz
Copy link

I bet the Go scripts are related. I'll give them a try and see if I can reproduce the problem.

If you could export your database to a ghidra zip file and upload it, that would be another way for me to try to replicate the decompiler problem.

@kajaaz
Copy link
Author

kajaaz commented Dec 1, 2023

I bet the Go scripts are related. I'll give them a try and see if I can reproduce the problem.

If you could export your database to a ghidra zip file and upload it, that would be another way for me to try to replicate the decompiler problem.

Yes probably. I have added here the ghidra zip file, hope it will help!

@sei-eschwartz
Copy link

Even with your database, I still don't get the same error :( I'm going to push a new release that prints the original exception. Can you try out https://github.com/CERTCC/kaiju/releases/tag/231201 and let me know what the error is?

@kajaaz
Copy link
Author

kajaaz commented Dec 4, 2023

Hi @sei-eschwartz,

Sure. I have tested different entry points and addresses and here is what I always get :

Error: java.lang.RuntimeException: Unable to create decompiler: java.lang.ClassNotFoundException:
docking.options.OptionsService

Build Date: 2023-Jul-11 1640 EDT
Ghidra Version: 10.3.2
Java Home: /home/usr/ghidra/OpenJDK17U-jdk_x64_linux_hotspot_17.0.8_7/jdk-17.0.8+7
JVM Version: Eclipse Adoptium 17.0.8
OS: Linux 6.2.0-37-generic amd64

ghidra_kaiju_bug

@sei-eschwartz
Copy link

Well, that's interesting. Apparently Kaiju was broken for Ghidra 10.3.2, and our tests weren't exercising that code.

This should be fixed now in release 231204. Let me know if not...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants