From f30c14bfec4b49e528a756b28cc010925e2f286b Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 1 Jul 2020 22:51:28 +0200 Subject: pkg/bisect: fix noop change detection with config minimization Config minimization did not update test results for the starting commit. Test result for the starting commit still refered to the original config, not the minimized config that was actually used during bisection. --- pkg/bisect/bisect_test.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'pkg/bisect/bisect_test.go') diff --git a/pkg/bisect/bisect_test.go b/pkg/bisect/bisect_test.go index 6815c1ab8..a7462a3b1 100644 --- a/pkg/bisect/bisect_test.go +++ b/pkg/bisect/bisect_test.go @@ -11,6 +11,7 @@ import ( "strconv" "testing" + "github.com/google/syzkaller/pkg/hash" "github.com/google/syzkaller/pkg/instance" "github.com/google/syzkaller/pkg/mgrconfig" "github.com/google/syzkaller/pkg/report" @@ -34,9 +35,10 @@ func (env *testEnv) BuildSyzkaller(repo, commit string) error { func (env *testEnv) BuildKernel(compilerBin, userspaceDir, cmdlineFile, sysctlFile string, kernelConfig []byte) (string, string, error) { commit := env.headCommit() - kernelSign := fmt.Sprintf("sign-%v", commit) + configHash := hash.String(kernelConfig) + kernelSign := fmt.Sprintf("%v-%v", commit, configHash) if commit >= env.test.sameBinaryStart && commit <= env.test.sameBinaryEnd { - kernelSign = "same-sign" + kernelSign = "same-sign-" + configHash } env.config = string(kernelConfig) if env.config == "baseline-fails" || env.config == "broken-build" { @@ -233,6 +235,18 @@ var bisectionTests = []BisectionTest{ baselineConfig: "minimize-fails", expectErr: true, }, + { + name: "config-minimize-same-hash", + startCommit: 905, + commitLen: 1, + expectRep: true, + culprit: 905, + sameBinaryStart: 904, + sameBinaryEnd: 905, + noopChange: true, + baselineConfig: "minimize-succeeds", + resultingConfig: "new-minimized-config", + }, // Tests that cause bisection returns error when crash does not reproduce // on the original commit. { -- cgit mrf-deployment