aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/csource.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-08-09 13:11:14 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-08-09 15:41:52 +0200
commit32e29dda2cf82b0dab7408bdef4c0af4d0a7fef8 (patch)
tree90f6af0be34a3577fb661d6be059f1fedba4d73c /pkg/csource/csource.go
parent8b78527436f4171d1fbd1c44b1954b7807ec5ef4 (diff)
pkg/repro: fix invalid options minimization
Repro can generate Sandbox="namespace"/UseTmpDir=false. This combination is broken for two reasons: - on second and subsequent executions of the program, it fails to create syz-tmp dir - with Procs>1, it fails right away, because all procs try to create syz-tmp dir Don't generate such combination.
Diffstat (limited to 'pkg/csource/csource.go')
-rw-r--r--pkg/csource/csource.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/csource/csource.go b/pkg/csource/csource.go
index e351a2e1d..163a9b065 100644
--- a/pkg/csource/csource.go
+++ b/pkg/csource/csource.go
@@ -51,11 +51,19 @@ type Options struct {
// Invalid combinations must not be passed to Write.
func (opts Options) Check() error {
if !opts.Threaded && opts.Collide {
+ // Collide requires threaded.
return errors.New("Collide without Threaded")
}
if !opts.Repeat && opts.Procs > 1 {
+ // This does not affect generated code.
return errors.New("Procs>1 without Repeat")
}
+ if opts.Sandbox == "namespace" && !opts.UseTmpDir {
+ // This is borken and never worked.
+ // This tries to create syz-tmp dir in cwd,
+ // which will fail if procs>1 and on second run of the program.
+ return errors.New("Sandbox=namespace without UseTmpDir")
+ }
return nil
}