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

fuzz: Invoking python interpreter from a C++ file #22973

Closed
stratospher opened this issue Sep 14, 2021 · 2 comments
Closed

fuzz: Invoking python interpreter from a C++ file #22973

stratospher opened this issue Sep 14, 2021 · 2 comments

Comments

@stratospher
Copy link
Contributor

I'm interested in reimplementing a python version of the new ChaCha20Poly1305@Bitcoin AEAD and fuzzing it against the C++ implementation. However since it involves invoking a python interpreter from inside a C++ file, I'm confused on how to proceed.

Possible Approaches

  1. using pipes to call the python script from the C++ file.
  2. using pybind11 to create the python C++ interface (idea from this PR). However the python to C++ code for the AEAD wouldn't be very readable here.

Would method 1 be ok? I'd love to hear your thoughts on how to proceed.

@maflcko
Copy link
Member

maflcko commented Aug 10, 2022

I think that calling into an external process disables the coverage tracking feature of fuzz engines we use (libfuzzer, afl, honggfuzz, ...). So I am not sure how useful it would be to add to this repo, as the CI-runs are based on a minimal set of inputs that reach maximal coverage. (It would still be run by google OSS-Fuzz and my fuzzing servers when generating).

However, I am also wondering how often the code would be modified. (The number of bugs found via fuzzing is correlated to the rate of changes made to the code). So maybe just implementing whatever you find easiest somewhere out-of-tree and then running it only once after the code is merged to master should be sufficient?

Or what about just using the recommended list of unit test vectors (if there is one) which would hopefully already cover all logic paths without the need for any fuzzing?

@stratospher
Copy link
Contributor Author

discussed in #23915

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

4 participants
@laanwj @maflcko @stratospher and others