spiriou/microADB

pipe_on_data_available (132): GOT ERROR nread -5, i/o error

Closed this issue · 2 comments

adb daemon runs in terminal 1 like ./build/adbd, adb shell xxx for adb shell test commands run in terminal 2 like adb shell date. It works fine in terminal 2 when I enter a valid adb shell command(such as adb shell date, adb shell ifconfig, adb shell ls and so on). However, something strange happens here, terminal1(adb daemon) shows the error message, pipe_on_data_available (132): GOT ERROR nread -5, i/o error. At the same time, I tried more adb shell command for testing, which seems to have the same effect, prompts an error in terminal 1, please refer to the following for the error message(I added more log for debug):

name is shell:ifconfig
adb_service_open (354): ########### name is shell:ifconfig
shell_service (263): cmd = ifconfig
shell_service (312): argv[0] sh
shell_service (313): argv[1] -c
shell_service (314): argv[2] ifconfig
shell_service (315): argv[3] (null)
adb_register_service (339): id=3, peer=1433
on_child_exit (93): shell 3<->1433 exited with status 0, signal 0
pipe_on_data_available (132): GOT ERROR nread -5, i/o error

In addition, when I enter an incomplete adb shell command in terminal 2, such as adb she, and then I enter the tab key in terminal 2 to complete my test command, terminal 2 shows the command completions, such as adb shell, and error messages in terminal 1, please refer to the following for error message:

name is shell:exit
adb_service_open (354): ########### name is shell:exit
shell_service (263): cmd = exit
shell_service (312): argv[0] sh
shell_service (313): argv[1] -c
shell_service (314): argv[2] exit
shell_service (315): argv[3] (null)
adb_register_service (339): id=8, peer=1470
pipe_on_data_available (132): GOT ERROR nread -5, i/o error
name is shell:getprop log.redirect-stdio
adb_service_open (354): ########### name is shell:getprop log.redirect-stdio
shell_service (263): cmd = getprop log.redirect-stdio
shell_service (312): argv[0] sh
shell_service (313): argv[1] -c
shell_service (314): argv[2] getprop log.redirect-stdio
shell_service (315): argv[3] (null)
adb_register_service (339): id=9, peer=1474
on_child_exit (93): shell 9<->1474 exited with status 127, signal 0
pipe_on_data_available (132): GOT ERROR nread -5, i/o error

I checked the libuv documentation here, nread is 5 corresponds to UV_EIO, and the corresponding description is i/o error.

In summary:

  • I'm not sure why the i/o error occurs here, the error message is too confusing, do you have a better way to fix it?
  • If this is not a problem, do we need to ignore this error message? If you agree with this, I can submit a PR to ignore it.

adb daemon runs in terminal 1 like ./build/adbd, adb shell xxx for adb shell test commands run in terminal 2 like adb shell date. It works fine in terminal 2 when I enter a valid adb shell command(such as adb shell date, adb shell ifconfig, adb shell ls and so on). However, something strange happens here, terminal1(adb daemon) shows the error message, pipe_on_data_available (132): GOT ERROR nread -5, i/o error. At the same time, I tried more adb shell command for testing, which seems to have the same effect, prompts an error in terminal 1, please refer to the following for the error message(I added more log for debug):

name is shell:ifconfig
adb_service_open (354): ########### name is shell:ifconfig
shell_service (263): cmd = ifconfig
shell_service (312): argv[0] sh
shell_service (313): argv[1] -c
shell_service (314): argv[2] ifconfig
shell_service (315): argv[3] (null)
adb_register_service (339): id=3, peer=1433
on_child_exit (93): shell 3<->1433 exited with status 0, signal 0
pipe_on_data_available (132): GOT ERROR nread -5, i/o error

In addition, when I enter an incomplete adb shell command in terminal 2, such as adb she, and then I enter the tab key in terminal 2 to complete my test command, terminal 2 shows the command completions, such as adb shell, and error messages in terminal 1, please refer to the following for error message:

name is shell:exit
adb_service_open (354): ########### name is shell:exit
shell_service (263): cmd = exit
shell_service (312): argv[0] sh
shell_service (313): argv[1] -c
shell_service (314): argv[2] exit
shell_service (315): argv[3] (null)
adb_register_service (339): id=8, peer=1470
pipe_on_data_available (132): GOT ERROR nread -5, i/o error
name is shell:getprop log.redirect-stdio
adb_service_open (354): ########### name is shell:getprop log.redirect-stdio
shell_service (263): cmd = getprop log.redirect-stdio
shell_service (312): argv[0] sh
shell_service (313): argv[1] -c
shell_service (314): argv[2] getprop log.redirect-stdio
shell_service (315): argv[3] (null)
adb_register_service (339): id=9, peer=1474
on_child_exit (93): shell 9<->1474 exited with status 127, signal 0
pipe_on_data_available (132): GOT ERROR nread -5, i/o error

I checked the libuv documentation here, nread is 5 corresponds to UV_EIO, and the corresponding description is i/o error.

In summary:

  • I'm not sure why the i/o error occurs here, the error message is too confusing, do you have a better way to fix it?
  • If this is not a problem, do we need to ignore this error message? If you agree with this, I can submit a PR to ignore it.

Attachment description: The test environment is ubuntu 18.04

I know this is not a right place to ask my question but does this microADB project also implements the adb server and client (host side) or just the daemon ?
Thanks