libfuzzer icon indicating copy to clipboard operation
libfuzzer copied to clipboard

Example `bananas.rs` not working

Open alpaylan opened this issue 5 months ago • 4 comments

Hi, I've been playing around with libfuzzer_sys and wanted to start from the basic examples, it seems that example that checks bananas.rs does not actually find the bug. I've ported the example to C++ and libfuzzer finds it instantly. I'm on an M4 Max with OSX Sequoia 15.5, my rustc version is rustc 1.91.0-nightly (f34ba774c 2025-08-03). I can provide other relevant information if needed.

alpaylan avatar Aug 08 '25 17:08 alpaylan

Does rustc/LLVM have full sanitizer support for macos now? I think that some has been added but I've never tried running any of the examples on anything but Linux.

fitzgen avatar Aug 08 '25 17:08 fitzgen

I've successfully tested rgb, and I've written a version of the bananas one that has 7 nested if's that check individual characters instead of checking for equality through slices and it works pretty quickly. So my intuition was that there's a problem with the coverage information the fuzzer receives.

alpaylan avatar Aug 08 '25 17:08 alpaylan

Yeah that coverage is provided by LLVM's coverage sanitizer, so it ties back into the sanitizer support question.

fitzgen avatar Aug 08 '25 17:08 fitzgen

Ah I see. I am able to pass RUSTFLAGS="-Zsanitizer=address" to rustc and unstable support seems to exist but I'm not sure if that answers you question.

Image

alpaylan avatar Aug 08 '25 17:08 alpaylan