diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2024-05-17 12:48:07 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-05-17 11:26:58 +0000 |
| commit | a12e99e74dfc7cbe54720d8383cec46aaf024a28 (patch) | |
| tree | 1f53d3842efba0b71cea49b4948c0c24450e47f9 | |
| parent | e09a60f8522234ba7968e421dd9d2e6d86af69db (diff) | |
pkg/csource: remove the Repro option
Enable it unconditionally.
| -rw-r--r-- | executor/common.h | 2 | ||||
| -rw-r--r-- | pkg/csource/common.go | 1 | ||||
| -rw-r--r-- | pkg/csource/csource.go | 4 | ||||
| -rw-r--r-- | pkg/csource/options.go | 7 | ||||
| -rw-r--r-- | pkg/csource/options_test.go | 7 | ||||
| -rw-r--r-- | pkg/repro/repro_test.go | 1 | ||||
| -rw-r--r-- | tools/syz-prog2c/prog2c.go | 2 |
7 files changed, 2 insertions, 22 deletions
diff --git a/executor/common.h b/executor/common.h index bfe6c76a7..9f130ca94 100644 --- a/executor/common.h +++ b/executor/common.h @@ -553,10 +553,8 @@ static void execute_one(void) static void loop(void) #endif { -#if SYZ_REPRO if (write(1, "executing program\n", sizeof("executing program\n") - 1)) { } -#endif #if SYZ_TRACE fprintf(stderr, "### start\n"); #endif diff --git a/pkg/csource/common.go b/pkg/csource/common.go index 600ac43b6..109863418 100644 --- a/pkg/csource/common.go +++ b/pkg/csource/common.go @@ -123,7 +123,6 @@ func commonDefines(p *prog.Prog, opts Options) map[string]bool { "SYZ_VHCI_INJECTION": opts.VhciInjection, "SYZ_USE_TMP_DIR": opts.UseTmpDir, "SYZ_HANDLE_SEGV": opts.HandleSegv, - "SYZ_REPRO": opts.Repro, "SYZ_TRACE": opts.Trace, "SYZ_WIFI": opts.Wifi, "SYZ_802154": opts.IEEE802154, diff --git a/pkg/csource/csource.go b/pkg/csource/csource.go index 3d019a59c..1f338b893 100644 --- a/pkg/csource/csource.go +++ b/pkg/csource/csource.go @@ -188,9 +188,7 @@ func (ctx *context) generateSyscalls(calls []string, hasVars bool) string { if len(calls) > 0 && (hasVars || opts.Trace) { fmt.Fprintf(buf, "\tintptr_t res = 0;\n") } - if opts.Repro { - fmt.Fprintf(buf, "\tif (write(1, \"executing program\\n\", sizeof(\"executing program\\n\") - 1)) {}\n") - } + fmt.Fprintf(buf, "\tif (write(1, \"executing program\\n\", sizeof(\"executing program\\n\") - 1)) {}\n") if opts.Trace { fmt.Fprintf(buf, "\tfprintf(stderr, \"### start\\n\");\n") } diff --git a/pkg/csource/options.go b/pkg/csource/options.go index 9490e394a..ba6dcfbed 100644 --- a/pkg/csource/options.go +++ b/pkg/csource/options.go @@ -48,9 +48,6 @@ type Options struct { UseTmpDir bool `json:"tmpdir,omitempty"` HandleSegv bool `json:"segv,omitempty"` - // Generate code for use with repro package to prints log messages, - // which allows to detect hangs. - Repro bool `json:"repro,omitempty"` Trace bool `json:"trace,omitempty"` LegacyOptions } @@ -169,7 +166,6 @@ func DefaultOpts(cfg *mgrconfig.Config) Options { Sandbox: cfg.Sandbox, UseTmpDir: true, HandleSegv: true, - Repro: true, } if cfg.TargetOS == targets.Linux { opts.NetInjection = true @@ -222,7 +218,7 @@ func deserializeLegacyOptions(data string, opts *Options) (int, error) { "HandleSegv": &opts.HandleSegv, "WaitRepeat": &ignoreBool, "Debug": &ignoreBool, - "Repro": &opts.Repro, + "Repro": &ignoreBool, } data = strings.TrimSpace(data) @@ -366,6 +362,5 @@ var ExecutorOpts = Options{ Procs: 2, Slowdown: 1, Sandbox: "none", - Repro: true, UseTmpDir: true, } diff --git a/pkg/csource/options_test.go b/pkg/csource/options_test.go index 5452f22ce..f7812e6b9 100644 --- a/pkg/csource/options_test.go +++ b/pkg/csource/options_test.go @@ -47,7 +47,6 @@ func TestParseOptionsCanned(t *testing.T) { CloseFDs: true, UseTmpDir: true, HandleSegv: true, - Repro: true, LegacyOptions: LegacyOptions{ Collide: true, Fault: true, @@ -72,7 +71,6 @@ func TestParseOptionsCanned(t *testing.T) { CloseFDs: true, UseTmpDir: true, HandleSegv: true, - Repro: true, LegacyOptions: LegacyOptions{ Collide: true, Fault: true, @@ -98,7 +96,6 @@ func TestParseOptionsCanned(t *testing.T) { CloseFDs: true, UseTmpDir: true, HandleSegv: true, - Repro: true, LegacyOptions: LegacyOptions{ Collide: true, Fault: true, @@ -118,7 +115,6 @@ func TestParseOptionsCanned(t *testing.T) { CloseFDs: true, UseTmpDir: true, HandleSegv: true, - Repro: false, LegacyOptions: LegacyOptions{ Collide: true, Fault: false, @@ -138,7 +134,6 @@ func TestParseOptionsCanned(t *testing.T) { CloseFDs: true, UseTmpDir: true, HandleSegv: true, - Repro: false, LegacyOptions: LegacyOptions{ Collide: true, Fault: false, @@ -158,7 +153,6 @@ func TestParseOptionsCanned(t *testing.T) { CloseFDs: true, UseTmpDir: true, HandleSegv: true, - Repro: false, LegacyOptions: LegacyOptions{ Collide: true, Fault: false, @@ -179,7 +173,6 @@ func TestParseOptionsCanned(t *testing.T) { CloseFDs: true, UseTmpDir: true, HandleSegv: true, - Repro: false, LegacyOptions: LegacyOptions{ Collide: true, Fault: false, diff --git a/pkg/repro/repro_test.go b/pkg/repro/repro_test.go index 744064c22..c61484754 100644 --- a/pkg/repro/repro_test.go +++ b/pkg/repro/repro_test.go @@ -91,7 +91,6 @@ func TestSimplifies(t *testing.T) { Cgroups: true, UseTmpDir: true, HandleSegv: true, - Repro: true, } var check func(opts csource.Options, i int) check = func(opts csource.Options, i int) { diff --git a/tools/syz-prog2c/prog2c.go b/tools/syz-prog2c/prog2c.go index adb83d73e..6b7394508 100644 --- a/tools/syz-prog2c/prog2c.go +++ b/tools/syz-prog2c/prog2c.go @@ -29,7 +29,6 @@ var ( flagHandleSegv = flag.Bool("segv", false, "catch and ignore SIGSEGV") flagUseTmpDir = flag.Bool("tmpdir", false, "create a temporary dir and execute inside it") flagTrace = flag.Bool("trace", false, "trace syscall results") - flagRepro = flag.Bool("repro", false, "add heartbeats used by pkg/repro") flagStrict = flag.Bool("strict", false, "parse input program in strict mode") flagLeak = flag.Bool("leak", false, "do leak checking") flagEnable = flag.String("enable", "none", "enable only listed additional features") @@ -95,7 +94,6 @@ func main() { Swap: features["swap"].Enabled, UseTmpDir: *flagUseTmpDir, HandleSegv: *flagHandleSegv, - Repro: *flagRepro, Trace: *flagTrace, } src, err := csource.Write(p, opts) |
