aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/runtest/run_test.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2025-06-23 16:36:00 +0200
committerAleksandr Nogikh <nogikh@google.com>2025-06-23 16:48:33 +0000
commit84d723cfd568e2286c960561ac5682fc741ab4b4 (patch)
tree0c19dba66619f544ccee14f7d58518e2a8121a09 /pkg/runtest/run_test.go
parentd6cdfb8a765c64793bc63cf630e68fbdd0ee0974 (diff)
pkg/runtest: collect syz-executor logs on failures
This will help us eventually debug #6109.
Diffstat (limited to 'pkg/runtest/run_test.go')
-rw-r--r--pkg/runtest/run_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/runtest/run_test.go b/pkg/runtest/run_test.go
index 09a401bb7..f37c7612c 100644
--- a/pkg/runtest/run_test.go
+++ b/pkg/runtest/run_test.go
@@ -484,6 +484,7 @@ func startRPCServer(t *testing.T, target *prog.Target, executor string,
// We don't need many procs for this test.
procs = min(procs, 4)
}
+ var output bytes.Buffer
cfg := &rpcserver.LocalConfig{
Config: rpcserver.Config{
Config: vminfo.Config{
@@ -504,6 +505,8 @@ func startRPCServer(t *testing.T, target *prog.Target, executor string,
GDB: *flagGDB,
MaxSignal: extra.maxSignal,
CoverFilter: extra.coverFilter,
+ // Note that when *flagGDB is set, the option is ignored.
+ OutputWriter: &output,
}
cfg.MachineChecked = func(features flatrpc.Feature, syscalls map[*prog.Syscall]bool) queue.Source {
if extra.machineChecked != nil {
@@ -520,6 +523,7 @@ func startRPCServer(t *testing.T, target *prog.Target, executor string,
t.Cleanup(func() {
done()
if err := <-errc; err != nil {
+ t.Logf("executor output:\n%s", output.String())
t.Fatal(err)
}
// We need to retry b/c we don't wait for all executor subprocesses (only set PR_SET_PDEATHSIG),
@@ -532,6 +536,7 @@ func startRPCServer(t *testing.T, target *prog.Target, executor string,
time.Sleep(100 * time.Millisecond)
continue
}
+ t.Logf("executor output:\n%s", output.String())
t.Fatalf("failed to remove temp dir %v: %v", dir, err)
}
})