class Runner

Defined at line 40 of file ../../src/sys/fuzzing/common/runner.h

This base class encapsulates the logic of performing a sequence of fuzzing runs. In

particular, it defines virtual methods for performing the fuzzing workflows asynchronously, and

invokes those methods on a dedicated worker thread to perform them without blocking the

controller's FIDL dispatcher thread.

Public Methods

ZxPromise<> Initialize (std::string pkg_dir, std::vector<std::string> args)

Sets up the runner using arguments from the component manifest.

Defined at line 21 of file ../../src/sys/fuzzing/common/runner.cc

zx_status_t AddToCorpus (CorpusType corpus_type, Input input)

Add an input to the specified corpus. Returns ZX_ERR_INVALID_ARGS if |corpus_type| is

unrecognized.

std::vector<Input> GetCorpus (CorpusType corpus_type)

Returns a copy of all non-empty inputs in the corpus of the given |corpus_type|.

The vector is sorted using Input's comparison operators.

zx_status_t ParseDictionary (const Input & input)

Parses the given |input| as an AFL-style dictionary. For format details, see

https://lcamtuf.coredump.cx/afl/technical_details.txt. Returns ZX_ERR_INVALID_ARGS if parsing

fails.

Input GetDictionaryAsInput ()

Returns the current dictionary serialized into an |Input|.

ZxPromise<Artifact> Fuzz ()

Implementation of `fuchsia.fuzzer.Controller/Fuzz`.

ZxPromise<Artifact> TryEach (std::vector<Input> inputs)
ZxPromise<Artifact> ValidateMinimize (Input input)

Implementation of `fuchsia.fuzzer.Controller/Minimize`. |ValidateMinimize| must be called

before |Minimize|.

ZxPromise<Artifact> Minimize (Artifact artifact)
ZxPromise<Artifact> Cleanse (Input input)

Implementation of `fuchsia.fuzzer.Controller/Cleanse`.

ZxPromise<> ValidateMerge ()

Implementation of `fuchsia.fuzzer.Controller/Merge`. |ValidateMerge| must be called

before |Merge|.

ZxPromise<Artifact> Merge ()
Status CollectStatus ()

Creates a |Status| object representing all attached processes.

ZxPromise<> Stop ()

Cancels the current workflow.

void ~Runner ()

Note that the destructor cannot call |Close|, |Interrupt| or |Join|, as they are virtual.

Instead, both this class and any derived class should have corresponding non-virtual "Impl"

methods and call those on destruction.

Defined at line 45 of file ../../src/sys/fuzzing/common/runner.h

const ExecutorPtr & executor ()

Accessors.

Defined at line 48 of file ../../src/sys/fuzzing/common/runner.h

const OptionsPtr & options ()

Defined at line 49 of file ../../src/sys/fuzzing/common/runner.h

ZxPromise<> Configure ()

Examines the options, and prepares the runner for fuzzing given their values.

Defined at line 93 of file ../../src/sys/fuzzing/common/runner.cc

void AddMonitor (fidl::InterfaceHandle<Monitor> monitor)

Adds a subscriber for status updates.

Defined at line 144 of file ../../src/sys/fuzzing/common/runner.cc

ZxPromise<Artifact> TryOne (Input input)

Implementation of `fuchsia.fuzzer.Controller/TryOne`.

Defined at line 121 of file ../../src/sys/fuzzing/common/runner.cc

Protected Methods

void Runner (ExecutorPtr executor)

Defined at line 17 of file ../../src/sys/fuzzing/common/runner.cc

void set_options (Options options)

Defined at line 105 of file ../../src/sys/fuzzing/common/runner.h

void UpdateMonitorsWithStatus (UpdateReason reason, Status status)

Labels the current status with the given `reason`, and sends it all attached `Monitor`s.

Defined at line 148 of file ../../src/sys/fuzzing/common/runner.cc

void UpdateMonitors (UpdateReason reason)

Like `UpdateMonitorsWithStatus`, but provides the status via `CollectStatus`.

Defined at line 155 of file ../../src/sys/fuzzing/common/runner.cc

void StartWorkflow (Scope & scope)

These methods allow specific runners to implement actions that should be performed at the start

or end of a workflow. They are called automatically by |Workflow|. The runners may also create

additional tasks constrained to the workflow's |scope|.

Defined at line 172 of file ../../src/sys/fuzzing/common/runner.h

void FinishWorkflow ()

Defined at line 173 of file ../../src/sys/fuzzing/common/runner.h

Records