-
Notifications
You must be signed in to change notification settings - Fork 37.7k
wip: Split fuzz binary (take 2) #30882
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
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/30882. ReviewsSee the guideline for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
target_compile_definitions(test_fuzz PRIVATE PROVIDE_FUZZ_MAIN_FUNCTION) | ||
if(BUILD_INDIVIDUAL_FUZZ_BINARIES) | ||
# bash command produces list of harnesses: <harness name> <source file> | ||
execute_process( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to produce an introspector report using this branch: https://github.com/dergoegge/oss-fuzz/tree/2024-09-bitcoin-introspector |
66c288a
to
d527100
Compare
🚧 At least one of the CI tasks failed. HintsMake sure to run all tests locally, according to the documentation. The failure may happen due to a number of reasons, for example:
Leave a comment here, if you need help tracking down a confusing failure. |
d527100
to
9aca33e
Compare
9aca33e
to
0cb1f4c
Compare
🐙 This pull request conflicts with the target branch and needs rebase. |
⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
It is now using FI-light, see https://introspector.oss-fuzz.com/project-profile?project=bitcoin-core and google/oss-fuzz#12983. Though, I am not sure about the takeaways. |
The full report (https://storage.googleapis.com/oss-fuzz-introspector/bitcoin-core/inspector-report/20250216/fuzz_report.html) still seems blocked on our dynamic harness look up. Maybe I'm looking at the wrong thing. |
No it is the right thing. I just wanted to leave a comment to say that FI will now fallback to the light version by default, so the build is already passing, but the result didn't look like it could be used. It could still make sense to try a FI run on this branch to see if it will help. |
The changes here could even be useful for afl++ on their own, but I haven't tried that either, as I am using libfuzzer. |
I've tried in the past but I kept running out of memory on a 128GB machine (see ossf/fuzz-introspector#1742). I don't know how much more memory is needed currently. The maintainer indicated that they'd look at it but doesn't look like they had time for this so far.
Yes, I listed some of the benefits in #28971. I do think getting FI to work would be the bigger benefit however. |
⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
cc @dergoegge . the issue #28971 is still open, so I guess this pull can be closed or rebased? |
Closes #28971
In addition to the benefits listed in #28971, this should also enable us to use https://github.com/ossf/fuzz-introspector provided by oss-fuzz. Our current runtime harness selection blocks introspector's static analysis from working properly (e.g. it can't statically determine which functions are reachable by a given harness).
This PR uses the approach suggested here: #29010 (comment). The list of available harnesses is determined (prior to compiling) by grepping for harness names in
FUZZ_TARGET
invocations. When compiling with-DBUILD_INDIVIDUAL_FUZZ_BINARIES=ON
, individual binaries for each harness are produced that no longer include the runtime lookup via theFUZZ
environment variable.build_fuzz/src/test/fuzz
will contain the individual binaries, which are prefixed withfuzz_*
.I'm opening this now to get some early feedback, there are still a few things to address:
-DBUILD_INDIVIDUAL_FUZZ_BINARIES
in the docs