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

Add a basic fuzz-harness #2794

Closed
wants to merge 2 commits into from

Conversation

nathaniel-brough
Copy link

Adds a basic fuzz testing harness.

Ref: #2793

@Enselic
Copy link
Collaborator

Enselic commented Dec 28, 2023

Interesting. I skimmed it over a bit. In (not unsafe) Rust, buffer overflows and null pointer dereferences can not happen, but it can still be useful to fuzz, I think.

Just curios: Did the fuzzer find any bugs yet?

@nathaniel-brough
Copy link
Author

Just curios: Did the fuzzer find any bugs yet?

Sort of... I found a lot of different ways to crash bat. e.g. if the terminal/tab width in the config is really large (larger than any normal terminal width) it'll crash with an out of memory condition. I didn't think that these where "real" bugs, as they would end up being pretty unlikely, and usually down to user error. I ended up constraining the fuzzer to keep these below specific values. But it depends on your definition of a bug.

@sharkdp
Copy link
Owner

sharkdp commented Jan 17, 2024

I love fuzz testing and used it extensively in another project of mine. I found quite a few interesting bugs using it.

For bat, the fact that you didn't find anything of substance (according to what you wrote above, please feel free to correct me if you think otherwise) is probably a hint that fuzz-testing is not as useful for this project. This does not mean that bat is bug free of course. But maybe it's a project that doesn't lend itself well to fuzz-testing.

In this sense: thank you very much for this experiment. But I think I'll close this without merging, in order for this not to turn into future maintenance work.

@sharkdp sharkdp closed this Jan 17, 2024
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.

3 participants