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

Feat/fuzzing #243

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft

Feat/fuzzing #243

wants to merge 3 commits into from

Conversation

FloydZ
Copy link
Collaborator

@FloydZ FloydZ commented Feb 12, 2025

Description

  • This PR adds fuzzing tests

DO NOT MERGE, only for discussion.

@FloydZ FloydZ mentioned this pull request Feb 12, 2025
@Dioprz Dioprz marked this pull request as draft February 15, 2025 23:24
@Dioprz
Copy link
Collaborator

Dioprz commented Feb 15, 2025

(I changed this to a draft to avoid accidental merging)

After some reads about Atheris and fuzzy testing, this sounds very interesting. Happy to learn about its existence.

Let me know if I can help with something here, @FloydZ.

@FloydZ
Copy link
Collaborator Author

FloydZ commented Feb 16, 2025

Hi @Dioprz ,
currently I'm not really 100% happy with the solution. There are two main issues:

  • atheris only allows for a single function to be fuzzed at each time. Thats why I have code like:
#atheris.Setup(sys.argv, SDFuzz)
...
atheris.Setup(sys.argv, RankSDFuzz)
...
#atheris.Setup(sys.argv, MAYOFuzz)

And you need enable/disable the estimator by hand. If you know how to circumvent that, without adding a bash script, which calls the python code multiple times. let me know.
The second problem is the exception handling. At first I thought catching ValueError is enough to separate between "real problematic" errors in the code, and errors which are already caught by the class constructor. But turns out errors like log2(0) are also ValueErrors, hence I have this ugly:

if type(e) != ValueError or str(e) == "math domain error":

check to difference between those two. If you have a better solution for this, I would really appreciate it. Plus Im not 100% that this is actually really correct.

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

Successfully merging this pull request may close these issues.

2 participants