From a12e99e74dfc7cbe54720d8383cec46aaf024a28 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Fri, 17 May 2024 12:48:07 +0200 Subject: pkg/csource: remove the Repro option Enable it unconditionally. --- pkg/csource/common.go | 1 - pkg/csource/csource.go | 4 +--- pkg/csource/options.go | 7 +------ pkg/csource/options_test.go | 7 ------- 4 files changed, 2 insertions(+), 17 deletions(-) (limited to 'pkg/csource') 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, -- cgit mrf-deployment