binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

Incorrect value for "ghinja.ghidra_install_path" in ~/Library/Application Support/Binary Ninja/settings.json Causes Crash on Launch

Open leaky-hub opened this issue 1 year ago • 2 comments

Version and Platform (required):

  • Binary Ninja Version: 4.1.5902 Personal, f2165c5d
  • OS: macos
  • OS Version: 14.6
  • CPU Architecture: arm64

Bug Description: Prerequisite: Ghinja plugin is enabled. The ghinja plugin requires a valid value / path for "ghinja.ghidra_install_path" in settings.json in order for the application to launch correctly. Users that move the location of Ghidra and do not update the value / path will encounter a crash on launch.

Steps To Reproduce:

  1. Install the Ghinja plugin and have Ghidra installed / downloaded
  2. Close Binary Ninja
  3. After entering the initial location of analyzeHeadless.bat, move the Ghidra directory (e.g. from downloads to documents).
  4. Launch Binary Ninja
  5. Observe the warning to enter location of analyzeHeadless.bat: image
  6. Hit 'OK' and observe the "Binary Ninja quit unexpectedly." error: image

Expected Behavior: Users should be able to enter the new location of "analyzeHeadless.bat" with validation and / or if location is invalid, Binary Ninja should launch without crashing so the user can re-enter the correct path in the plugin settings.

Additional Information Users can fix this by going into ~/Library/Application Support/Binary Ninja/settings.json and readjusting the value of "ghinja.ghidra_install_path" to the correct one: image

leaky-hub avatar Aug 20 '24 16:08 leaky-hub

This is an issue in https://github.com/Martyx00/ghinja, which is third-party plugin that we do not control

xusheng6 avatar Aug 27 '24 14:08 xusheng6

Please file an issue on the ghinja plugin repository. We will look into the crash as we shouldn't be crashing regardless.

plafosse avatar Aug 27 '24 14:08 plafosse

This is the line of code in the plugin in question that is causing the crash: https://github.com/Martyx00/ghinja/blob/fe3fab3d7e51fe53cd6a75279465c08413043bc3/init.py#L31

The plugin itself won't install and run anymore because it uses the now-removed DockHandler. I've tried to re-create the issue with a mashed-together version of the code that matters and haven't been able to. I'm guessing the crash either has something to do with the way the message box was created or some bug that used to exist in either Binary Ninja or Qt.

Without an actual crash report, and without the plugin being actively maintained (or working at all, as of next release), I am going to close this as not planned. If anyone comes across another situation that crashes like this and has more information we can use to reproduce it, please reopen this or make a new issue and we'll take a look.

fuzyll avatar Feb 08 '25 05:02 fuzyll