aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/osutil
diff options
context:
space:
mode:
authorSabyrzhan Tasbolatov <snovitoll@gmail.com>2024-09-17 01:10:32 +0500
committerDmitry Vyukov <dvyukov@google.com>2024-09-23 08:03:41 +0000
commit49f9c2d289d546c97aae87130574abe5b963b72a (patch)
treeff45b7339ce694a523b3df2a657bebd4f1510557 /pkg/osutil
parent6f888b7530906167ecb1f5a35e060fec736d6d32 (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/osutil')
-rw-r--r--pkg/osutil/osutil.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/osutil/osutil.go b/pkg/osutil/osutil.go
index a619f9169..465679ced 100644
--- a/pkg/osutil/osutil.go
+++ b/pkg/osutil/osutil.go
@@ -68,7 +68,7 @@ func Run(timeout time.Duration, cmd *exec.Cmd) ([]byte, error) {
if <-timedout {
text = fmt.Sprintf("timedout after %v %q", timeout, cmd.Args)
}
- exitCode := 0
+ exitCode := cmd.ProcessState.ExitCode()
var exitErr *exec.ExitError
if errors.As(err, &exitErr) {
if status, ok := exitErr.Sys().(syscall.WaitStatus); ok {