Incorrect value for "ghinja.ghidra_install_path" in ~/Library/Application Support/Binary Ninja/settings.json Causes Crash on Launch
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:
- Install the Ghinja plugin and have Ghidra installed / downloaded
- Close Binary Ninja
- After entering the initial location of analyzeHeadless.bat, move the Ghidra directory (e.g. from downloads to documents).
- Launch Binary Ninja
- Observe the warning to enter location of analyzeHeadless.bat:
- Hit 'OK' and observe the "Binary Ninja quit unexpectedly." error:
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:
This is an issue in https://github.com/Martyx00/ghinja, which is third-party plugin that we do not control
Please file an issue on the ghinja plugin repository. We will look into the crash as we shouldn't be crashing regardless.
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.