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

ghidra exits abnormally?Is it a bug of Ghidrathon Or Jep? #14

Closed
Vang3lis opened this issue Oct 30, 2022 · 10 comments · Fixed by #41
Closed

ghidra exits abnormally?Is it a bug of Ghidrathon Or Jep? #14

Vang3lis opened this issue Oct 30, 2022 · 10 comments · Fixed by #41
Milestone

Comments

@Vang3lis
Copy link

Here is the log.

hs_err_pid121091.log

@Vang3lis Vang3lis changed the title ghidra exits abnormally?Is it a bugs of Ghidrathon Or Jep? ghidra exits abnormally?Is it a bug of Ghidrathon Or Jep? Oct 30, 2022
@IdanH101
Copy link

Same thing happened to me when I ran my python script twice - ghidra crashed.
Maybe it relates to issue #7 ?

@IdanH101
Copy link

@Vang3lis why did you close it? The problem still exists

@Vang3lis
Copy link
Author

Sorry, I close this issue just because the issue #7 you metioned has answer my question. I will reopen it.

@Vang3lis Vang3lis reopened this Oct 31, 2022
@mike-hunhoff
Copy link
Collaborator

Thank you for the report @Vang3lis . Can you please provide additional information including:

  • Ghidra version
  • Python version
  • Operating system
  • Does the crash occur each time? Or is it nondeterministic?
  • I gather from the attached log file this occurred when executing a script name ghidrathon_example.py. Is this the unmodified script shipped with Ghidrathon? If not and if possible, can you provide the referenced script?

@IdanH101 if possible can you also please provide provide the additional information requested above?

@Vang3lis
Copy link
Author

Vang3lis commented Nov 1, 2022

Ghidra version: 10.1.2 OR 10.1.5 both can trigger.
Python version: 3.8.10 (I use the local python env)
Operating system: Ubuntu20.04 in VMware

Nondeterministic and it crashes when the script runs more than once. I do some modifications on this script. Here is the script.
ghidrathon_example.zip

@IdanH101
Copy link

IdanH101 commented Nov 1, 2022

Ghidra version: 10.1.2
Python version: 3.6.5
O.S.: Windows 10

Crashes everytime I run any python script more than once.

@IdanH101
Copy link

IdanH101 commented Nov 1, 2022

Ghidra version: 10.1.2 Python version: 3.6.5 O.S.: Windows 10

Crashes everytime I run any python script more than once.

I was wrong. I checked many scripts, but it just accured to me they all used numpy with multiarray!
The example script actually works great.

Further investigation lead me to this thread:
numpy/numpy#19149

Is it possible that Ghidrathon have a problem with it for the reasons specified in that thread? Is there a work around?

@mike-hunhoff
Copy link
Collaborator

Ghidra version: 10.1.2 OR 10.1.5 both can trigger. Python version: 3.8.10 (I use the local python env) Operating system: Ubuntu20.04 in VMware

Nondeterministic and it crashes when the script runs more than once. I do some modifications on this script. Here is the script. ghidrathon_example.zip

@Vang3lis I had to modify the script that you attached to execute what I believe to be the intended entry method _analyze. Additionally, I had to comment out some lines to avoid a "method not found" exception. Following this I was able to execute your script but I could not re-create the issue. Can you please verify that you attached the correct script? Or ensure the attached script fully executes as intended in case the issue lies in the commented lines (65-69).

@mike-hunhoff
Copy link
Collaborator

Ghidra version: 10.1.2 Python version: 3.6.5 O.S.: Windows 10
Crashes everytime I run any python script more than once.

I was wrong. I checked many scripts, but it just accured to me they all used numpy with multiarray! The example script actually works great.

Further investigation lead me to this thread: numpy/numpy#19149

Is it possible that Ghidrathon have a problem with it for the reasons specified in that thread? Is there a work around?

@IdanH101 thank you for taking a second look. This issue appears to be caused by Ghidrathon's use of Jep's SubInterpreter versus Jep's SharedInterpreter (see Jep discussion here). TLDR; numpy does not work with sub-interpreters resulting in the crashes you are experiencing. For now, numpy usage should be avoided until we can find a configuration that works for Ghidrathon. I'll open a separate issue to track progress. If you could provide an example script that uses numpy resulting in a crash that would certainly help.

@Vang3lis
Copy link
Author

Vang3lis commented Nov 5, 2022

Ghidra version: 10.1.2 OR 10.1.5 both can trigger. Python version: 3.8.10 (I use the local python env) Operating system: Ubuntu20.04 in VMware
Nondeterministic and it crashes when the script runs more than once. I do some modifications on this script. Here is the script. ghidrathon_example.zip

@Vang3lis I had to modify the script that you attached to execute what I believe to be the intended entry method _analyze. Additionally, I had to comment out some lines to avoid a "method not found" exception. Following this I was able to execute your script but I could not re-create the issue. Can you please verify that you attached the correct script? Or ensure the attached script fully executes as intended in case the issue lies in the commented lines (65-69).

Sorry, when I attached the script, I have modified some lines which are not related in my thought. I removed the line "import angr" and lines 65-69 should be commented.

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

Successfully merging a pull request may close this issue.

3 participants