aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/instance/execprog.go9
-rw-r--r--pkg/manager/diff.go7
-rw-r--r--pkg/report/report.go2
3 files changed, 11 insertions, 7 deletions
diff --git a/pkg/instance/execprog.go b/pkg/instance/execprog.go
index 83461d07e..0b9f9ebf7 100644
--- a/pkg/instance/execprog.go
+++ b/pkg/instance/execprog.go
@@ -120,13 +120,16 @@ func (inst *ExecProgInstance) runCommand(command string, duration time.Duration,
command = inst.StraceBin + filterCalls + ` -s 100 -x -f ` + command
prefixOutput = []byte(fmt.Sprintf("%s\n\n<...>\n", command))
}
- opts := []any{exitCondition}
+ optionalBeforeContext := func(*vm.RunOptions) {}
if inst.BeforeContextLen != 0 {
- opts = append(opts, vm.OutputSize(inst.BeforeContextLen))
+ optionalBeforeContext = vm.WithBeforeContext(inst.BeforeContextLen)
}
ctxTimeout, cancel := context.WithTimeout(context.Background(), duration)
defer cancel()
- output, rep, err := inst.VMInstance.Run(ctxTimeout, inst.reporter, command, opts...)
+ output, rep, err := inst.VMInstance.Run(ctxTimeout, inst.reporter, command,
+ vm.WithExitCondition(exitCondition),
+ optionalBeforeContext,
+ )
if err != nil {
return nil, fmt.Errorf("failed to run command in VM: %w", err)
}
diff --git a/pkg/manager/diff.go b/pkg/manager/diff.go
index 4b4013169..ef70d7aa8 100644
--- a/pkg/manager/diff.go
+++ b/pkg/manager/diff.go
@@ -636,9 +636,10 @@ func (kc *kernelContext) runInstance(ctx context.Context, inst *vm.Instance,
cmd := fmt.Sprintf("%v runner %v %v %v", executorBin, inst.Index(), host, port)
ctxTimeout, cancel := context.WithTimeout(ctx, kc.cfg.Timeouts.VMRunningTime)
defer cancel()
- _, rep, err := inst.Run(ctxTimeout, kc.reporter, cmd, vm.ExitTimeout,
- vm.InjectExecuting(injectExec),
- vm.EarlyFinishCb(func() {
+ _, rep, err := inst.Run(ctxTimeout, kc.reporter, cmd,
+ vm.WithExitCondition(vm.ExitTimeout),
+ vm.WithInjectExecuting(injectExec),
+ vm.WithEarlyFinishCb(func() {
// Depending on the crash type and kernel config, fuzzing may continue
// running for several seconds even after kernel has printed a crash report.
// This litters the log and we want to prevent it.
diff --git a/pkg/report/report.go b/pkg/report/report.go
index 2ac039fdd..088f8c089 100644
--- a/pkg/report/report.go
+++ b/pkg/report/report.go
@@ -74,7 +74,7 @@ type Report struct {
Executor *ExecutorInfo
// reportPrefixLen is length of additional prefix lines that we added before actual crash report.
reportPrefixLen int
- // symbolized is set if the report is symbolized.
+ // symbolized is set if the report is symbolized. It prevents double symbolization.
symbolized bool
}