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

Opening directory causes analysis to get stuck #3259

Open
1 of 3 tasks
karliss opened this issue Nov 4, 2023 · 1 comment
Open
1 of 3 tasks

Opening directory causes analysis to get stuck #3259

karliss opened this issue Nov 4, 2023 · 1 comment
Labels

Comments

@karliss
Copy link
Member

karliss commented Nov 4, 2023

Environment information

  • Operating System: Linux
  • Cutter version: ~ 2.2.0 13953d2
  • Obtained from:
    • Built from source
    • Downloaded release from Cutter website or GitHub
    • Distribution repository
  • File format:

Describe the bug

I accidentally pasted directory path instead of full file path. This resulted in analysis getting stuck.

From a quick inspection seems like failure to open file resulted in rizin/cutter assuming that the valid memory range goes got 0x7fffffffffffff and thus analyses was taking forever to process endless range of nothing.

Trying to do similar thing in plain rizin resulted in ERROR: [d] Cannot open directory. I assume that similar thing happens within rizin, but Cutter doesn't check the error reported by rizin and proceeds with further steps after opening attempt which then acts badly .

To Reproduce

Steps to reproduce the behavior:

  1. Open "open file" window
  2. Type or paste directory path in the path input
  3. Proceed to open and analyze
  4. Observe that analysis gets stuck

Expected behavior

Cutter shows an error.

Additional potential edge cases:

  • macos .app
  • non file IO modes, some of which expect special filesystem objects which are not files, and some of them non fiilesytem path strings

It might be better to improve the checking of errors returned by rizin, instead of adding early file/folder check within Cutter. That would potentially allow dealing with other reasons causing file opening to fail, it would also reduce the need to deal with the various edgecases of non file IO modes.

Screenshots

Additional context

@karliss karliss added the BUG label Nov 4, 2023
@karliss
Copy link
Member Author

karliss commented Nov 4, 2023

After looking at it more the error checking on rizin side for this might not be as good as I thought. Searching for the error string I saw, it seems like the folder check, that prevented opening folder using plain rizin, happens within rz_main_rizin which cutter of course doesn't use .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant