rust-fuzz / libfuzzer

Rust bindings and utilities for LLVM’s libFuzzer
Apache License 2.0
208 stars 44 forks source link

Include Debug-formatted output in fuzzer output #48

Closed Manishearth closed 4 years ago

Manishearth commented 4 years ago

Fixes https://github.com/rust-fuzz/libfuzzer-sys/issues/47

This is really a proof of concept. Ideally we can upstream LLVMFuzzerCustomOutput, and also we can make this work so that it is able to turn itself off for types that don't implement Debug.

Thoughts? @nagisa @fitzgen

Manishearth commented 4 years ago

If folks like this approach I'll go ahead and try to upstream the libfuzzer patch.

fitzgen commented 4 years ago

Does this only get called when a bug is found?

Manishearth commented 4 years ago

Yep.

Manishearth commented 4 years ago

Fuzzer::DumpCurrentUnit is what libfuzzer uses to dump out the failing test string at the end, in multiple formats (bytestring, list of hex bytes, base64, and to a file).

Manishearth commented 4 years ago

Upstreaming at https://reviews.llvm.org/D70738

fitzgen commented 4 years ago

We did an alternative implementation in #53