-
Notifications
You must be signed in to change notification settings - Fork 35
Add fuzz tests #549
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 fuzz tests #549
Conversation
62476a1
to
8406c94
Compare
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
on: [workflow_call] |
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.
Remember to revert this back before merging.
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.
Okey
e069266
to
b1b4df5
Compare
@@ -205,3 +205,5 @@ jobs: | |||
MultiNuma: | |||
needs: [Build] | |||
uses: ./.github/workflows/multi_numa.yml | |||
Nightly: | |||
uses: ./.github/workflows/nightly.yml |
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.
this should be removed before merge, right?
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.
Yes
test/fuzz/umfFuzz.cpp
Outdated
int ret = -1; | ||
|
||
int (*api_wrappers[])(TestState &) = { | ||
umf_memory_provider_alloc, umf_memory_provider_free, umf_pool_create, |
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.
please use // clang-format off .... // clang-format on
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.
Please add --verbose to ctest command (you can remove it just before merge_
I checked your pr localy - and it looks really strange.
First of all i have at the beginning:
This may also happen if the target rejected all inputs we tried so far
Then execution hangs for few mins and then starts running
i tried also just execute ./fuzztest without ctest
then i see something what looks on prompt, during this hang(after a minute or two it starts running)
NEW_FUNC[1/153]:
Not sure if it is expected or not.
Next point: are you sure that we are testing our library? For me we are only testing the test. If we are passing fuzzer flag only to the test, fuzzer only check coverage of this file, while library coverage is not analyzed, to generate better input. am i right?
Done
I don't have this rejection message when running the tests locally. This "bug" might be due to different environments or configurations?
Yes, we are testing our library. The fuzzing is configured to test API calls defined in umfFuzz.cpp. LibFuzzer needs a clearly defined entry point (main), and in our case, the entry point is LLVMFuzzerTestOneInput, which LibFuzzer calls. The implementation of this function in umfFuzz.cpp determines which parts of the API are tested. LibFuzzer doesn’t function like a coverage tools - it doesn’t "understand" the entire API on its own. We define how to process the fuzzed bytes in the entry point and which API functions are called based on that input. |
There has to be a test case with the As to the hangs you get, I don't get any when I run this test locally. |
from https://llvm.org/docs/LibFuzzer.html
|
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.
It works for me 👍
I get this may be not the complete solution, but this is just an entry point for us - the issue for fuzz testing is not set as resolved here.
This change should make it: szadam#6 |
continued in #572 |
This PR is a first of many related to fuzzing - ref. #528