kpumuk commented on code in PR #3339: URL: https://github.com/apache/thrift/pull/3339#discussion_r2924065762
########## lib/rb/test/fuzz/README.md: ########## @@ -0,0 +1,99 @@ +# Ruby Fuzzing README + +The Ruby Thrift implementation uses [Ruzzy](https://github.com/trailofbits/ruzzy) for fuzzing. Ruzzy is a coverage-guided fuzzer for pure Ruby code and Ruby C extensions. + +We currently have several fuzz targets that test different aspects of the Thrift implementation: + +- `fuzz_parse_binary_protocol.rb` -- fuzzes deserialization of the Binary protocol +- `fuzz_parse_binary_protocol_accelerated.rb` -- fuzzes deserialization of the accelerated Binary protocol +- `fuzz_parse_compact_protocol.rb` -- fuzzes deserialization of the Compact protocol +- `fuzz_parse_json_protocol.rb` -- fuzzes deserialization of JSON protocol messages +- `fuzz_roundtrip_binary_protocol.rb` -- fuzzes Binary roundtrips (deserialize, serialize, deserialize, compare) +- `fuzz_roundtrip_binary_protocol_accelerated.rb` -- fuzzes accelerated Binary roundtrips +- `fuzz_roundtrip_compact_protocol.rb` -- fuzzes Compact roundtrips +- `fuzz_roundtrip_json_protocol.rb` -- fuzzes JSON message roundtrips + +The runnable files in this directory are tracer entrypoints. Ruzzy requires that pure Ruby fuzzing starts from a tracer script which then loads a separate harness, so do not invoke the matching `_harness.rb` files directly. + +The fuzzers use Ruzzy's mutation engine to generate test cases. Each target uses common testing code from `fuzz_common.rb`. + +For more information about Ruzzy and its options, see the [Ruzzy documentation](https://github.com/trailofbits/ruzzy). + +You can also use the corpus generator from the Rust implementation to generate initial Binary and Compact corpora that can be reused by the Ruby fuzzers, since those wire formats are identical between implementations. + +## Usage + +```bash Review Comment: This is a little bit OS specific, so I am not quite sure what is the best approach here. Could you point me to how other languages do it? I was checking [your PR](https://github.com/google/oss-fuzz/pull/13874/changes) against oss-fuzz, and see that most of the languages do different things to set everything up. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
