diff options
| author | Sabyrzhan Tasbolatov <snovitoll@gmail.com> | 2024-09-17 01:10:32 +0500 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-09-23 08:03:41 +0000 |
| commit | 49f9c2d289d546c97aae87130574abe5b963b72a (patch) | |
| tree | ff45b7339ce694a523b3df2a657bebd4f1510557 /pkg/bisect | |
| parent | 6f888b7530906167ecb1f5a35e060fec736d6d32 (diff) | |
pkg/build: handle OOM-killed build error
Handle SIGKILL (exit code = 137) on osutil.Run() during Linux kernel image
building and return build.InfraError without reporting.
Fixes: https://github.com/google/syzkaller/issues/5317
Diffstat (limited to 'pkg/bisect')
| -rw-r--r-- | pkg/bisect/bisect.go | 14 | ||||
| -rw-r--r-- | pkg/bisect/bisect_test.go | 2 |
2 files changed, 4 insertions, 12 deletions
diff --git a/pkg/bisect/bisect.go b/pkg/bisect/bisect.go index 339838039..e00c54c68 100644 --- a/pkg/bisect/bisect.go +++ b/pkg/bisect/bisect.go @@ -134,14 +134,6 @@ type Result struct { Confidence float64 } -type InfraError struct { - Title string -} - -func (e InfraError) Error() string { - return e.Title -} - // Run does the bisection and returns either the Result, // or, if the crash is not reproduced on the start commit, an error. func Run(cfg *Config) (*Result, error) { @@ -158,7 +150,7 @@ func Run(cfg *Config) (*Result, error) { return nil, err } if _, err = repo.CheckoutBranch(cfg.Kernel.Repo, cfg.Kernel.Branch); err != nil { - return nil, &InfraError{Title: fmt.Sprintf("%v", err)} + return nil, &build.InfraError{Title: fmt.Sprintf("%v", err)} } return runImpl(cfg, repo, inst) } @@ -692,7 +684,7 @@ func (env *env) test() (*testResult, error) { if err != nil { problem := fmt.Sprintf("repro testing failure: %v", err) env.log(problem) - return res, &InfraError{Title: problem} + return res, &build.InfraError{Title: problem} } bad, good, infra, rep, types := env.processResults(current, results) res.verdict, err = env.bisectionDecision(len(results), bad, good, infra) @@ -851,7 +843,7 @@ func (env *env) bisectionDecision(total, bad, good, infra int) (vcs.BisectResult // We have been unable to determine a verdict mostly because of infra errors. // Abort the bisection. return vcs.BisectSkip, - &InfraError{Title: "unable to determine the verdict because of infra errors"} + &build.InfraError{Title: "unable to determine the verdict because of infra errors"} } env.logf("unable to determine the verdict: %d good runs (wanted %d), for bad wanted %d in total, got %d", good, wantGoodRuns, wantTotalRuns, good+bad) diff --git a/pkg/bisect/bisect_test.go b/pkg/bisect/bisect_test.go index eead42335..cb5e51c5b 100644 --- a/pkg/bisect/bisect_test.go +++ b/pkg/bisect/bisect_test.go @@ -651,7 +651,7 @@ var bisectionTests = []BisectionTest{ startCommit: 905, expectRep: false, expectErr: true, - expectErrType: &InfraError{}, + expectErrType: &build.InfraError{}, infraErrStart: 600, infraErrEnd: 800, introduced: "602", |
