aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2025-08-21 11:35:15 +0200
committerTaras Madan <tarasmadan@google.com>2025-08-28 11:36:44 +0000
commit6c8b90a1abc330c4e05307ddb268b084a02cd2a3 (patch)
tree0aeeab06948096b0a8b6c60495e3a4dba4291258 /pkg
parent443c11c765c0bf86d91595bf5edd50af4476fdc6 (diff)
vm: extract all the crashes from the log
Diffstat (limited to 'pkg')
-rw-r--r--pkg/build/netbsd.go6
-rw-r--r--pkg/instance/execprog.go6
-rw-r--r--pkg/manager/diff.go7
-rw-r--r--pkg/manager/repro.go1
4 files changed, 14 insertions, 6 deletions
diff --git a/pkg/build/netbsd.go b/pkg/build/netbsd.go
index 21564e1aa..199ebc424 100644
--- a/pkg/build/netbsd.go
+++ b/pkg/build/netbsd.go
@@ -158,13 +158,13 @@ func (ctx netbsd) copyKernelToDisk(targetArch, vmType, outputDir, kernel string)
commands = append(commands, "sync") // Run sync so that the copied image is stored properly.
ctxTimeout, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
- _, rep, err := inst.Run(ctxTimeout, reporter, strings.Join(commands, ";"))
+ _, reps, err := inst.Run(ctxTimeout, reporter, strings.Join(commands, ";"))
if err != nil {
return fmt.Errorf("error syncing the instance %w", err)
}
// Make sure that the command has executed properly.
- if rep != nil {
- return fmt.Errorf("error executing sync: %v", rep.Title)
+ if len(reps) > 0 {
+ return fmt.Errorf("error executing sync: %v", reps[0].Title)
}
return nil
}
diff --git a/pkg/instance/execprog.go b/pkg/instance/execprog.go
index 0b9f9ebf7..7c97819f4 100644
--- a/pkg/instance/execprog.go
+++ b/pkg/instance/execprog.go
@@ -126,10 +126,14 @@ func (inst *ExecProgInstance) runCommand(command string, duration time.Duration,
}
ctxTimeout, cancel := context.WithTimeout(context.Background(), duration)
defer cancel()
- output, rep, err := inst.VMInstance.Run(ctxTimeout, inst.reporter, command,
+ output, reps, err := inst.VMInstance.Run(ctxTimeout, inst.reporter, command,
vm.WithExitCondition(exitCondition),
optionalBeforeContext,
)
+ var rep *report.Report
+ if len(reps) > 0 {
+ rep = reps[0]
+ }
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 57340314e..8b57e5807 100644
--- a/pkg/manager/diff.go
+++ b/pkg/manager/diff.go
@@ -675,7 +675,7 @@ 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,
+ _, reps, err := inst.Run(ctxTimeout, kc.reporter, cmd,
vm.WithExitCondition(vm.ExitTimeout),
vm.WithInjectExecuting(injectExec),
vm.WithEarlyFinishCb(func() {
@@ -685,7 +685,10 @@ func (kc *kernelContext) runInstance(ctx context.Context, inst *vm.Instance,
kc.serv.StopFuzzing(inst.Index())
}),
)
- return rep, err
+ if len(reps) > 0 {
+ return reps[0], err
+ }
+ return nil, err
}
func (kc *kernelContext) triageProgress() float64 {
diff --git a/pkg/manager/repro.go b/pkg/manager/repro.go
index e7034b186..184945c5c 100644
--- a/pkg/manager/repro.go
+++ b/pkg/manager/repro.go
@@ -31,6 +31,7 @@ type Crash struct {
Manual bool
FullRepro bool // used by the diff fuzzer to do a full scale reproduction
*report.Report
+ TailReports []*report.Report
}
func (c *Crash) FullTitle() string {