androidlinuxdebianadb

ADB Check failed: payload.size() <= bytes_left


After a recent Debian testing (Debian 13 or trixie) update, adb on my pc broke. And it broke on a kernel or even on a cpu level.

Now it just disconnects after some messages (randomly) from the android 10 client. It doesn't write anything in the server log:

adb     : adb_io.cpp:81 readx: fd=3 wanted=5
adb     : adb_io.cpp:91 readx: fd=3 disconnected

However, in the client logcat, there is this error:

Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 9165 (UsbFfs-worker), pid 9051 (adbd)
09-18 19:00:54.015  9249  9249 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-18 19:00:54.015  9249  9249 F DEBUG   : Build fingerprint: 'Blackview/BV6300_RU/BV6300:10/QP1A.190711.020/1603869746:user/release-keys'
09-18 19:00:54.015  9249  9249 F DEBUG   : Revision: '0'
09-18 19:00:54.016  9249  9249 F DEBUG   : ABI: 'arm64'
09-18 19:00:54.017  9249  9249 F DEBUG   : Timestamp: 2024-09-18 19:00:54+0300
09-18 19:00:54.018  9249  9249 F DEBUG   : pid: 9051, tid: 9165, name: UsbFfs-worker  >>> /system/bin/adbd <<<
09-18 19:00:54.018  9249  9249 F DEBUG   : uid: 2000
09-18 19:00:54.018  9249  9249 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
09-18 19:00:54.019  9249  9249 F DEBUG   : Abort message: 'Check failed: payload.size() <= bytes_left (payload.size()=234, bytes_left=210) '
09-18 19:00:54.019  9249  9249 F DEBUG   :     x0  0000000000000000  x1  00000000000023cd  x2  0000000000000006  x3  00000075122fe750
09-18 19:00:54.019  9249  9249 F DEBUG   :     x4  8080800000000000  x5  8080800000000000  x6  8080800000000000  x7  0000000000808080
09-18 19:00:54.019  9249  9249 F DEBUG   :     x8  00000000000000f0  x9  0000007515bca4e0  x10 0000000000000000  x11 0000000000000001
09-18 19:00:54.019  9249  9249 F DEBUG   :     x12 00000075122fe348  x13 0000000000000028  x14 0000000000000001  x15 00002f308762823c
09-18 19:00:54.019  9249  9249 F DEBUG   :     x16 0000007515c968c0  x17 0000007515c74060  x18 0000007511e54000  x19 00000000000000ac
09-18 19:00:54.019  9249  9249 F DEBUG   :     x20 000000000000235b  x21 00000000000000b2  x22 00000000000023cd  x23 00000000ffffffff
09-18 19:00:54.019  9249  9249 F DEBUG   :     x24 00000075122ff020  x25 0000007515292783  x26 000000751529266f  x27 0000007515295800
09-18 19:00:54.019  9249  9249 F DEBUG   :     x28 0000007515293381  x29 00000075122fe800
09-18 19:00:54.019  9249  9249 F DEBUG   :     sp  00000075122fe730  lr  0000007515c28170  pc  0000007515c281a0
09-18 19:00:54.026  9249  9249 F DEBUG   : 
09-18 19:00:54.026  9249  9249 F DEBUG   : backtrace:
09-18 19:00:54.026  9249  9249 F DEBUG   :       #00 pc 00000000000821a0  /apex/com.android.runtime/lib64/bionic/libc.so (abort+176) (BuildId: 2a5abdc9c768b33656f7aa8d9ce5cf54)
09-18 19:00:54.026  9249  9249 F DEBUG   :       #01 pc 000000000000bc3c  /system/lib64/libbase.so (android::base::DefaultAborter(char const*)+12) (BuildId: 74e39b9e4bda61561a36377476803040)
09-18 19:00:54.026  9249  9249 F DEBUG   :       #02 pc 000000000000c650  /system/lib64/libbase.so (android::base::LogMessage::~LogMessage()+608) (BuildId: 74e39b9e4bda61561a36377476803040)
09-18 19:00:54.026  9249  9249 F DEBUG   :       #03 pc 0000000000045a14  /system/lib64/libadbd.so (UsbFfsConnection::ProcessRead(IoBlock*)+1092) (BuildId: 93b60fecb49163389170739f789011b7)
09-18 19:00:54.027  9249  9249 F DEBUG   :       #04 pc 00000000000452cc  /system/lib64/libadbd.so (UsbFfsConnection::HandleRead(TransferId, long)+124) (BuildId: 93b60fecb49163389170739f789011b7)
09-18 19:00:54.027  9249  9249 F DEBUG   :       #05 pc 0000000000045158  /system/lib64/libadbd.so (UsbFfsConnection::ReadEvents()+120) (BuildId: 93b60fecb49163389170739f789011b7)
09-18 19:00:54.027  9249  9249 F DEBUG   :       #06 pc 0000000000044f00  /system/lib64/libadbd.so (_ZZN16UsbFfsConnection11StartWorkerEvENKUlvE_clEv+736) (BuildId: 93b60fecb49163389170739f789011b7)
09-18 19:00:54.027  9249  9249 F DEBUG   :       #07 pc 0000000000044be4  /system/lib64/libadbd.so (_ZNSt3__114__thread_proxyINS_5tupleIJNS_10unique_ptrINS_15__thread_structENS_14default_deleteIS3_EEEEZN16UsbFfsConnection11StartWorkerEvEUlvE_EEEEEPvSA_+44) (BuildId: 93b60fecb49163389170739f789011b7)
09-18 19:00:54.027  9249  9249 F DEBUG   :       #08 pc 00000000000e2364  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: 2a5abdc9c768b33656f7aa8d9ce5cf54)
09-18 19:00:54.027  9249  9249 F DEBUG   :       #09 pc 0000000000083d98  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 2a5abdc9c768b33656f7aa8d9ce5cf54)

Here is an example of how it goes:

admin@debian:~$ adb shell
BV6300:/ $ dmesg --help
usage: dmesg [-Cc] [-r|-t|-T] [-n LEVEL] [-s SIZE] [-w]

Print or control the kernel ring buffer.

-C  Clear ring buffer without printing
...

BV6300:/ $ logcat --help
***disconnect***
admin@debian:~$

It also errors with logcat while printing the log on a seemingly random line.


I tried using a different system - Xubuntu 23(old, end of life) that works with adb on my other pc (that has old hardware), without luck. Also tried: adb version, linux version, android phone from the same manufacturer, different model.

I tried the Google SDK(google-android-platform-tools-installer 35.0.1) , Debian package(adb 34.0.4-1.1) and Xubuntu Google SDK 33. All these previously worked.

There was no system update on the phones that could update adbd.

Motherboard: HUANAN X99-F8

CPU: Intel® Xeon® E5-2678 v3 × 24


Solution

  • The answser was actually pretty simple: The USB cable was bad.

    I didn't expect this because it failed only on large packets. This seems like a sync issue.