aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/csource')
-rw-r--r--pkg/csource/csource.go8
-rw-r--r--pkg/csource/csource_test.go13
2 files changed, 15 insertions, 6 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
}
diff --git a/pkg/csource/csource_test.go b/pkg/csource/csource_test.go
index ae34a9499..e4e9e1f7f 100644
--- a/pkg/csource/csource_test.go
+++ b/pkg/csource/csource_test.go
@@ -85,12 +85,13 @@ func allOptionsPermutations() []Options {
func TestOne(t *testing.T) {
rs, _ := initTest(t)
opts := Options{
- Threaded: true,
- Collide: true,
- Repeat: true,
- Procs: 2,
- Sandbox: "namespace",
- Repro: true,
+ Threaded: true,
+ Collide: true,
+ Repeat: true,
+ Procs: 2,
+ Sandbox: "namespace",
+ Repro: true,
+ UseTmpDir: true,
}
p := prog.GenerateAllSyzProg(rs)
testOne(t, p, opts)