From c6509052a04c3ba3d383b17946ebd6cdbb9ca89c Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Wed, 5 Jul 2023 15:35:45 +0200 Subject: pkg/report: ignore transient crashes There are cases when a crash, even though it didn't occur during boot and image testing phases, still should not be counted during bisection. Otherwise we risk diverting the whole process in the wrong direction. One of such problem classes is getting SYZFATAL errors when we are not bisecting a SYZFATAL crash. --- pkg/bisect/bisect_test.go | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'pkg/bisect/bisect_test.go') diff --git a/pkg/bisect/bisect_test.go b/pkg/bisect/bisect_test.go index 80709c85e..47251b8cc 100644 --- a/pkg/bisect/bisect_test.go +++ b/pkg/bisect/bisect_test.go @@ -93,7 +93,20 @@ func (env *testEnv) Test(numVMs int, reproSyz, reproOpts, reproC []byte) ([]inst } return ret, nil } - return make([]instance.EnvTestResult, numVMs), nil + ret = make([]instance.EnvTestResult, numVMs-1) + if env.test.injectSyzFailure { + ret = append(ret, instance.EnvTestResult{ + Error: &instance.TestError{ + Report: &report.Report{ + Title: "SYZFATAL: test", + Type: crash.SyzFailure, + }, + }, + }) + } else { + ret = append(ret, instance.EnvTestResult{}) + } + return ret, nil } func (env *testEnv) headCommit() int { @@ -259,10 +272,11 @@ type BisectionTest struct { expectErr bool expectErrType any // Expect res.Report != nil. - expectRep bool - noopChange bool - isRelease bool - flaky bool + expectRep bool + noopChange bool + isRelease bool + flaky bool + injectSyzFailure bool // Expected number of returned commits for inconclusive bisection. commitLen int // For cause bisection: Oldest commit returned by bisection. @@ -404,6 +418,16 @@ var bisectionTests = []BisectionTest{ culprit: 500, isRelease: true, }, + // Tests that bisection returns the correct fix commit despite SYZFATAL. + { + name: "fix-finds-fix-despite-syzfatal", + fix: true, + startCommit: 400, + injectSyzFailure: true, + commitLen: 1, + culprit: 500, + isRelease: true, + }, // Tests that fix bisection returns error when crash does not reproduce // on the original commit. { -- cgit mrf-deployment