syz-manager: add option to turn off crash reproducing

Reproducing is still turned on by default,
turning it off can be useful for benchmarking.
This commit is contained in:
Dmitry Vyukov 2017-01-19 12:33:54 +01:00
parent affae90ec4
commit c4f622fcb3
2 changed files with 8 additions and 2 deletions

View File

@ -53,8 +53,9 @@ type Config struct {
Machine_Type string // GCE machine type (e.g. "n1-highcpu-2")
Cover bool // use kcov coverage (default: true)
Leak bool // do memory leak checking
Cover bool // use kcov coverage (default: true)
Leak bool // do memory leak checking
Reproduce bool // reproduce, localize and minimize crashers (on by default)
Enable_Syscalls []string
Disable_Syscalls []string
@ -87,6 +88,7 @@ func parse(data []byte) (*Config, map[int]bool, error) {
}
cfg := new(Config)
cfg.Cover = true
cfg.Reproduce = true
cfg.Sandbox = "setuid"
if err := json.Unmarshal(data, cfg); err != nil {
return nil, nil, fmt.Errorf("failed to parse config file: %v", err)
@ -317,6 +319,7 @@ func checkUnknownFields(data []byte) (string, error) {
"Devices",
"Procs",
"Cover",
"Reproduce",
"Sandbox",
"Leak",
"Enable_Syscalls",

View File

@ -462,6 +462,9 @@ func (mgr *Manager) saveCrash(crash *Crash) {
const maxReproAttempts = 3
func (mgr *Manager) needRepro(desc string) bool {
if !mgr.cfg.Reproduce {
return false
}
sig := hash.Hash([]byte(desc))
dir := filepath.Join(mgr.crashdir, sig.String())
if _, err := os.Stat(filepath.Join(dir, "repro.prog")); err == nil {