aboutsummaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
authorSebastian Ene <sebastianene@google.com>2026-01-14 13:56:59 +0200
committerAleksandr Nogikh <nogikh@google.com>2026-01-20 08:32:46 +0000
commitfaf99a10ff35487a689ef7a183b1081da5369152 (patch)
treeee4c21d02bc04902792870e7fd8f3d7780550926 /vm
parent572effc1e38bd5189752c98d08f439f1043d825c (diff)
vm/adb: don't check for ret code on adb shell reboot
Prevent the fuzzer from entering in an infinte loop of device reboots when the adb shell reboot command returns with an error code. Fixes: #6598 Signed-off-by: Sebastian Ene <sebastianene@google.com>
Diffstat (limited to 'vm')
-rw-r--r--vm/adb/adb.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/vm/adb/adb.go b/vm/adb/adb.go
index 79c4ebe12..d8d78e833 100644
--- a/vm/adb/adb.go
+++ b/vm/adb/adb.go
@@ -9,6 +9,7 @@ import (
"bytes"
"context"
"encoding/json"
+ "errors"
"fmt"
"io"
"os"
@@ -390,8 +391,16 @@ func (inst *instance) repair() error {
// reliable solution can be sought out.
if inst.cfg.TargetReboot {
if _, err := inst.adb("shell", "reboot"); err != nil {
- return err
+ var verboseErr *osutil.VerboseError
+ if !errors.As(err, &verboseErr) {
+ return err
+ }
+
+ if verboseErr.ExitCode != 0 && verboseErr.ExitCode != 255 {
+ return err
+ }
}
+
// Now give it another 5 minutes to boot.
if !vmimpl.SleepInterruptible(10 * time.Second) {
return fmt.Errorf("shutdown in progress")