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

Division By Zero Traceback #79

Open
whoismissing opened this issue Jan 19, 2024 · 2 comments
Open

Division By Zero Traceback #79

whoismissing opened this issue Jan 19, 2024 · 2 comments

Comments

@whoismissing
Copy link

I've found it's possible when running ghidriff bin1 bin2 to get a ZeroDivisionError

Traceback (most recent call last):
  File "/home/wsl2/Envs/bd/bin/ghidriff", line 8, in <module>
    sys.exit(main())
  File "/home/wsl2/Envs/bd/lib/python3.10/site-packages/ghidriff/__main__.py", line 87, in main
    pdiff = d.diff_bins(diff[0], diff[1])
  File "/home/wsl2/Envs/bd/lib/python3.10/site-packages/ghidriff/ghidra_diff_engine.py", line 1491, in diff_bins
    match_func_similarity_percent = f'{((matched_funcs_no_changes_len / matched_funcs_len)*100):.4f}%'
ZeroDivisionError: division by zero
@clearbluejar
Copy link
Owner

ah good find. I'll add a test case for this.

@clearbluejar
Copy link
Owner

I am having a really difficult time finding a div by zero test case, so I just added some checks around the divisors.

Can you share a copy of the bins that cause this error?

clearbluejar added a commit that referenced this issue Jan 30, 2024
clearbluejar added a commit that referenced this issue Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants