-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Add fuzzer version of randomized prevector test #18529
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 fuzz tests are not shipped on our website, nor are they run as part of Concept ACK on the new fuzzing harness. |
maflcko
left a comment
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.
ACK on the fuzzer
a8c3f23 to
b1d24d1
Compare
|
@MarcoFalke Rebased, addressed your comments, and removed removal of the existing unit test (I've duplicated instead of creating a common shared class, as I expect the two to diverge - the existing test is much more suited as an approach for fuzzing, while we may want a few static cases instead as unit tests). |
|
ACK b1d24d1 🍬 Show signature and timestampSignature: |
b1d24d1 Reorder the test instructions by number (Pieter Wuille) c2ccadc Merge and generalize case 3 and case 6 (Pieter Wuille) 402ad5a Only run sanity check once at the end (Pieter Wuille) eda8309 Assert immediately rather than caching failure (Pieter Wuille) 5560845 Make a fuzzer-based copy of the prevector randomized test (Pieter Wuille) Pull request description: The current prevector test effectively randomly generates a number of operations to perform on a prevector and a normal vector, and checks consistency between the two. By converting this into a fuzzer the operations can be targetted rather than random. ACKs for top commit: MarcoFalke: ACK b1d24d1 🍬 Tree-SHA512: 2b5c62abcd5fee94f42db03400531484d98c59e7f4308e0e683c61aabcd9ce42f85c5d058d2d5e7f8221124f71d2112b6a5f3c80e5d0fdae265a70647747e92f
Summary: ``` The current prevector test effectively randomly generates a number of operations to perform on a prevector and a normal vector, and checks consistency between the two. By converting this into a fuzzer the operations can be targetted rather than random. ``` Backport of core [[bitcoin/bitcoin#18529 | PR18529]]. Test Plan: ninja bitcoin-fuzzers ./src/test/fuzz/prevector <path_to_corpus> Reviewers: #bitcoin_abc, majcosta Reviewed By: #bitcoin_abc, majcosta Differential Revision: https://reviews.bitcoinabc.org/D9003
| test.resize(std::max(0, std::min(30, (int)test.size() + prov.ConsumeIntegralInRange<int>(0, 4) - 2))); | ||
| break; | ||
| case 2: | ||
| test.insert(prov.ConsumeIntegralInRange<size_t>(0, test.size()), 1 + prov.ConsumeBool(), prov.ConsumeIntegral<int>()); |
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.
post-merge question: Is there a reason to limit the number of elements inserted in this case to 1 or 2?
backport: bitcoin#18417, bitcoin#18521, bitcoin#18529, bitcoin#18176, bitcoin#18423, bitcoin#17926, bitcoin#18353, bitcoin#18407, bitcoin#18455, bitcoin#18565, bitcoin#18867 (fuzzing harness backports: part 2)
The current prevector test effectively randomly generates a number of operations to perform on a prevector and a normal vector, and checks consistency between the two.
By converting this into a fuzzer the operations can be targetted rather than random.