rust-lang/log

Optional dependency on arbitrary to support fuzzing of loggers

cukie opened this issue · 1 comments

cukie commented

Hello! I'm working on writing a fuzzer for the android_logger crate as part of the Android Open Source Project. An initial draft of the proposed fuzzer can be found here.

This fuzzer requires a good bit of boilerplate to implement the Arbitrary (https://github.com/rust-fuzz/arbitrary/) trait for log::Level and log::LevelFilter. I was wondering if there would be any appetite for a contribution that would include the Arbitrary implementation for these enums as an optional dependency of the log crate to reduce the amount of boilerplate that downstream fuzzers need to write.

I believe the implementation could be as straightforward as adding #[cfg_attr(feature = "arbitrary", derive(Arbitrary))] to the relevant enums.

I would be happy to work on this and provide a PR if it sounds reasonable to maintainers here.

cukie commented

I've created a proof of concept PR to serve as a starting point for this discussion! #531