This is an archive of the discontinued LLVM Phabricator instance.

[libFuzzer] Add INFO output when LLVMFuzzerCustomMutator is found.
ClosedPublic

Authored by Dor1s on Jan 21 2020, 1:00 PM.

Details

Summary

there is an ongoing work on interchangeable custom mutators
(https://github.com/google/clusterfuzz/pull/1333/files#r367706283)
and having some sort of signalling from libFuzzer that it has loaded
a custom mutator would be helpful.

The initial idea was to make the mutator to print something, but given
the anticipated variety of different mutators, it does not seem possible
to make all of them print the same message to signal their execution.

Diff Detail

Event Timeline

Dor1s created this revision.Jan 21 2020, 1:00 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 21 2020, 1:00 PM
Herald added subscribers: llvm-commits, Restricted Project. · View Herald Transcript
metzman accepted this revision.Jan 21 2020, 1:17 PM

LGTM. This seems like a generic way of handling this and is especially useful when using LD_PRELOAD to load custom mutators since iirc LD_PRELOAD doesn't make so much noise when it fails.

compiler-rt/lib/fuzzer/FuzzerDriver.cpp
201

Maybe drop "by default" I don't think they can opt out right?

This revision is now accepted and ready to land.Jan 21 2020, 1:17 PM
Dor1s marked 2 inline comments as done.Jan 21 2020, 1:39 PM
Dor1s added inline comments.
compiler-rt/lib/fuzzer/FuzzerDriver.cpp
201

Actually it can be overwritten by a value passed via cmd and there is a test for that!

metzman added inline comments.Jan 21 2020, 2:40 PM
compiler-rt/lib/fuzzer/FuzzerDriver.cpp
201

ACK. LGTM

Dor1s marked an inline comment as done.Jan 22 2020, 12:53 PM

Given that this is a simple change and Kostya is a busy man I'm going to go ahead and land this. We can always revert if there is any concern.

Dor1s updated this revision to Diff 239678.Jan 22 2020, 12:55 PM

one rebase is never enough

Harbormaster completed remote builds in B44622: Diff 239678.
This revision was automatically updated to reflect the committed changes.