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

Cutter plugin causes cutter to abort without explanation when rizin plugin isn't loaded #360

Open
martinmake opened this issue Oct 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@martinmake
Copy link

When I was packaging rz-ghidra for GNU Guix I've ran into a difficult issue which made me build the whole suite in debug mode and run it through gdb, because of no meaningfull error massage on abort.

Steps to reproduce:

$ cutter --no-rizin-plugins --no-output-redirect ./a.out
normal output for loading plugins/analizing
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_M_construct null not valid
aborted

Or just make sure that Rizin part of the plugin isn't where Rizin looks for plugins.

The issue comes from src/core_ghidra.cpp and is caused by
std::string ConfigVar::GetString(RzConfig *cfg) const { return rz_config_get(cfg, name.c_str()); }
constructing a std::string from NULL, returned by rz_config_get with "ghidra.lang", which basically means that Rizin didn't load the plugin. But rather than giving us a meaning full message and continuing to operate normaly, the program aborts.

Possible solutions:

  1. At least print error message in ConfigVar::GetString or rz_config_get, when variables are not found.
  2. Make Cutter check for it's plugins dependencies on Rizin plugins and just show a warning and don't use the plugin when they're not met.

I've ran into this issue basically because Cutter does a way better job of loading it's plugins, while Rizin looks into at most 3 directories (RZ_LIB_PLUGINS, RZ_EXTRA_PLUGINS, RZ_USER_PLUGINS), which are set in stone when you build Rizin. So a possible improvement is to port Cutter's plugin loading system to Rizin.

I've chosen to post this issue in this repository because the actual exceptions isn't being caugh in it's code, but as you can see from my elaboration, the issue concers Rizin and Cutter as well.

@thestr4ng3r thestr4ng3r added the bug Something isn't working label Oct 13, 2024
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

No branches or pull requests

2 participants