Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( StatNoExecRequests = stat.New("no exec requests", "Number of times fuzzer was stalled with no exec requests", stat.Rate{}) StatNoExecDuration = stat.New("no exec duration", "Total duration fuzzer was stalled with no exec requests (ns/sec)", stat.Rate{}) StatExecBufferTooSmall = stat.New("buffer too small", "Program serialization overflowed exec buffer", stat.NoGraph) )
Common stats related to fuzzing that are updated/read by different parts of the system.
var ErrRequestAborted = errors.New("context closed while waiting the result")
Functions ¶
This section is empty.
Types ¶
type Deduplicator ¶
type Deduplicator struct {
// contains filtered or unexported fields
}
Deduplicator() keeps track of the previously run requests to avoid re-running them.
func (*Deduplicator) Next ¶
func (d *Deduplicator) Next() *Request
type Distributor ¶
type Distributor struct {
// contains filtered or unexported fields
}
Distributor distributes requests to different VMs during input triage (allows to avoid already used VMs).
func Distribute ¶
func Distribute(source Source) *Distributor
func (*Distributor) Next ¶
func (dist *Distributor) Next(vm int) *Request
Next returns the next request to execute on the given vm.
type DoneCallback ¶
type DynamicOrderer ¶
type DynamicOrderer struct {
// contains filtered or unexported fields
}
func DynamicOrder ¶
func DynamicOrder() *DynamicOrderer
DynamicOrder() can be used to form nested queues dynamically. That is, if q1 := pq.Append() q2 := pq.Append() All elements added via q2.Submit() will always have a *lower* priority than all elements added via q1.Submit().
func (*DynamicOrderer) Append ¶
func (do *DynamicOrderer) Append() Executor
func (*DynamicOrderer) Next ¶
func (do *DynamicOrderer) Next() *Request
type DynamicSourceCtl ¶
type DynamicSourceCtl struct {
// contains filtered or unexported fields
}
func DynamicSource ¶
func DynamicSource(source Source) *DynamicSourceCtl
DynamicSource is assumed never to point to nil.
func (*DynamicSourceCtl) Next ¶
func (ds *DynamicSourceCtl) Next() *Request
func (*DynamicSourceCtl) Store ¶
func (ds *DynamicSourceCtl) Store(source Source)
type Executor ¶
type Executor interface {
Submit(req *Request)
}
Executor describes the interface wanted by the producers of requests. After a Request is submitted, it's expected that the consumer will eventually take it and report the execution result via Done().
type ExecutorID ¶
type PlainQueue ¶
type PlainQueue struct {
// contains filtered or unexported fields
}
PlainQueue is a straighforward thread-safe Request queue implementation.
func Plain ¶
func Plain() *PlainQueue
func (*PlainQueue) Len ¶
func (pq *PlainQueue) Len() int
func (*PlainQueue) Next ¶
func (pq *PlainQueue) Next() *Request
func (*PlainQueue) Submit ¶
func (pq *PlainQueue) Submit(req *Request)
type RandomQueue ¶
type RandomQueue struct {
// contains filtered or unexported fields
}
RandomQueue holds up to |size| elements. Next() evicts a random one. On Submit(), if the queue is full, a random element is replaced.
func NewRandomQueue ¶
func NewRandomQueue(size int, rnd *rand.Rand) *RandomQueue
func (*RandomQueue) Next ¶
func (rq *RandomQueue) Next() *Request
func (*RandomQueue) Submit ¶
func (rq *RandomQueue) Submit(req *Request)
type Request ¶
type Request struct { // Type of the request. // RequestTypeProgram executes Prog, and is used by most requests (also the default zero value). // RequestTypeBinary executes binary with file name stored in Data. // RequestTypeGlob expands glob pattern stored in Data. Type flatrpc.RequestType ExecOpts flatrpc.ExecOpts Prog *prog.Prog // for RequestTypeProgram BinaryFile string // for RequestTypeBinary GlobPattern string // for RequestTypeGlob // Return all signal for these calls instead of new signal. ReturnAllSignal []int ReturnError bool ReturnOutput bool // This stat will be incremented on request completion. Stat *stat.Val // Important requests will be retried even from crashed VMs. Important bool // Avoid specifies set of executors that are preferable to avoid when executing this request. // The restriction is soft since there can be only one executor at all or available right now. Avoid []ExecutorID // contains filtered or unexported fields }
func (*Request) OnDone ¶
func (r *Request) OnDone(cb DoneCallback)
type Result ¶
type Result struct { Info *flatrpc.ProgInfo Executor ExecutorID Output []byte Status Status Err error // More details in case of ExecFailure. }
type Source ¶
type Source interface {
Next() *Request
}
Source describes the interface wanted by the consumers of requests.
func Deduplicate ¶
func DefaultOpts ¶
DefaultOpts applies opts to all requests in source.