Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vm/adb: exitcode 255 on adb is normal behaviour #4807

Open
Notselwyn opened this issue May 14, 2024 · 5 comments
Open

vm/adb: exitcode 255 on adb is normal behaviour #4807

Notselwyn opened this issue May 14, 2024 · 5 comments
Labels

Comments

@Notselwyn
Copy link

Describe the bug
adb returns exitcode 255 when performing adb shell reboot, resulting in Syzkaller thinking the repair() sequence failed, whilst the device is just rebooting. This causes an Create() device loop.

To Reproduce
Run Syzkaller over (cabled) adb with a recent Google Pixel

$ adb --version
Android Debug Bridge version 1.0.41
Version 35.0.1-11580240

Expected behavior
Syzkaller shouldn't treat exitcode 255 as error on reboot.

@Notselwyn Notselwyn added the bug label May 14, 2024
@Notselwyn
Copy link
Author

I encountered this on a March 2023 Syzkaller version. I have updated to the latest commit but now I encounter:

$ ~/opt/syzkaller/bin/syz-manager -config android.cfg -debug
2024/05/14 12:17:52 serving http on http://127.0.0.1:56741
2024/05/14 12:17:52 serving rpc on tcp://[::]:42085
2024/05/14 12:17:52 booting test machines...
2024/05/14 12:17:52 wait for the connection from test machine...
2024/05/14 12:17:53 executing adb [wait-for-device]
2024/05/14 12:17:53 adb returned
2024/05/14 12:17:53 executing adb [shell reboot]
2024/05/14 12:18:10 adb returned
2024/05/14 12:18:10 [FATAL] VM is exited while checking is not done

@Notselwyn
Copy link
Author

Update: it's the same bug (exitcode 255) on the newest Syzkaller, but on the newer Syzkaller versions it doesn't loop reboots (which is normal).

@dvyukov
Copy link
Collaborator

dvyukov commented May 15, 2024

Expected behavior Syzkaller shouldn't treat exitcode 255 as error on reboot.

How do we know it has rebooted then? Isn't it a bug in adb?

@Notselwyn
Copy link
Author

Good suggestion. I'll hit up the adb folks and report back when I have an update.

@Notselwyn
Copy link
Author

Notselwyn commented May 16, 2024

The code in ./vm/adb.go says:

	// History: adb reboot episodically hangs, so we used a more reliable way:
	// using syz-executor to issue reboot syscall. However, this has stopped
	// working, probably due to the introduction of seccomp. Therefore,
	// we revert this to `adb shell reboot` in the meantime, until a more
	// reliable solution can be sought out.

Is this still the case? It seems adb reboot does not error when successfully rebooting, so it would fix the issue I was experiencing.

If the issue from the comment isn't still the case, then I would suggest that replacing adb shell reboot with adb reboot would be a great fix. With regards to the adb issue itself, I have yet to hear an decision from the adb team

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants