Closed Bug 1581158 Opened 9 months ago Closed 8 months ago

Add support for fuzzing rust modules from fuzzing interfaces


(Core :: Fuzzing, enhancement)

Not set



Tracking Status
firefox71 --- fixed


(Reporter: truber, Assigned: truber)


(Blocks 1 open bug)



(1 file)

This adds support for writing a libFuzzer target in rust for rust code. I used dkeeler's rkv-fuzz as an example -- the fuzzing function is unmodified.

This has failures in try I don't understand yet:

Linux x64 asan fuzzing builds ok for me locally.

What can I/we do about those failures? It'd be good to start fuzzing rkv sooner rather than later.

Flags: needinfo?(jschwartzentruber)
Flags: needinfo?(choller)

decoder and I figured out the macos problem. I had the sancov Rust flags set for host targets which shouldn't be. Linux is still broken but only in TC, I haven't been able to repro locally.

Emilio knows everything, maybe he can spot the problem here?

Flags: needinfo?(emilio)

If it happens locally it should be easy to see what if anything is calling them, but...

I bet those calls come from the rust standard library. But usually if you don't call them they get optimized away by LTO, and thus they don't appear in gkrust.

I wouldn't be surprised if the instrumentation that you're adding makes the linker not remove them, or something of that sort...

I think you should be able to repro locally, if you have a release build with LTO enabled.

This check is only enabled if -Clto is passed to rust:

Note that to verify that this is passing locally you may need to change this to not look at MOZ_AUTOMATION:

So that you can see TEST-PASS | check_networking...

So tldr I think that the instrumentation the sancov flags are adding are disabling lto, effectively, or something of that sort.

So probably extending the check in to avoid doing this when passes=sancov is included, or something like that, may be the best option. But this is just a guess, so verifying that locally would be useful.

Flags: needinfo?(emilio)

@emilio, thanks! I had commented out the MOZ_AUTOMATION check in so it would print in either case, but I saw nothing. I was missing --enable-release in my mozconfig, so now it fails locally. I'll disable the check for this case.

Flags: needinfo?(choller)
Flags: needinfo?(jschwartzentruber)
Keywords: checkin-needed
Keywords: checkin-needed
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
Depends on: 1617186
You need to log in before you can comment on or make changes to this bug.