ipc

package
v0.0.0-...-4e6bda9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagDebug            = uint64(1) << iota // debug output from executor
	FlagSignal                               // collect feedback signals (coverage)
	FlagThreaded                             // use multiple threads to mitigate blocked syscalls
	FlagCollide                              // collide syscalls to provoke data races
	FlagSandboxSetuid                        // impersonate nobody user
	FlagSandboxNamespace                     // use namespaces for sandboxing
	FlagEnableTun                            // initialize and use tun in executor
	FlagEnableFault                          // enable fault injection support
)

Configuration flags for Config.Flags.

View Source
const (
	FlagCollectCover = uint64(1) << iota // collect coverage
	FlagDedupCover                       // deduplicate coverage in executor
	FlagInjectFault                      // inject a fault in this execution (see ExecOpts)
	FlagCollectComps                     // collect KCOV comparisons
)

Per-exec flags for ExecOpts.Flags:

Variables

This section is empty.

Functions

func GetCompMaps

func GetCompMaps(info []CallInfo) []prog.CompMap

Types

type CallInfo

type CallInfo struct {
	Signal []uint32 // feedback signal, filled if FlagSignal is set
	Cover  []uint32 // per-call coverage, filled if FlagSignal is set and cover == true,
	//if dedup == false, then cov effectively contains a trace, otherwise duplicates are removed
	Comps         prog.CompMap // per-call comparison operands
	Errno         int          // call errno (0 if the call was successful)
	FaultInjected bool
}

type Config

type Config struct {
	// Flags are configuation flags, defined above.
	Flags uint64

	// Timeout is the execution timeout for a single program.
	Timeout time.Duration

	// AbortSignal is the signal to send to the executor in error conditions.
	AbortSignal int

	// BufferSize is the size of the internal buffer for executor output.
	BufferSize uint64
}

Config is the configuration for Env.

func DefaultConfig

func DefaultConfig() (Config, error)

type Env

type Env struct {
	StatExecs    uint64
	StatRestarts uint64
	// contains filtered or unexported fields
}

func MakeEnv

func MakeEnv(bin string, pid int, config Config) (*Env, error)

func (*Env) Close

func (env *Env) Close() error

func (*Env) Exec

func (env *Env) Exec(opts *ExecOpts, p *prog.Prog) (output []byte, info []CallInfo, failed, hanged bool, err0 error)

Exec starts executor binary to execute program p and returns information about the execution: output: process output info: per-call info failed: true if executor has detected a kernel bug hanged: program hanged and was killed err0: failed to start process, or executor has detected a logical error

type ExecOpts

type ExecOpts struct {
	Flags     uint64
	FaultCall int // call index for fault injection (0-based)
	FaultNth  int // fault n-th operation in the call (0-based)
}

type ExecutorFailure

type ExecutorFailure string

ExecutorFailure is returned from MakeEnv or from env.Exec when executor terminates by calling fail function. This is considered a logical error (a failed assert).

func (ExecutorFailure) Error

func (err ExecutorFailure) Error() string

type Gate

type Gate struct {
	// contains filtered or unexported fields
}

Gate limits concurrency level and window to the given value. Limitation of concurrency window means that if a very old activity is still running it will not let new activities to start even if concurrency level is low.

func NewGate

func NewGate(c int, f func()) *Gate

If f is not nil, it will be called after each batch of c activities.

func (*Gate) Enter

func (g *Gate) Enter() int

func (*Gate) Leave

func (g *Gate) Leave(idx int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL