facebookarchive / fb-adb

A better shell for Android devices
Other
1.14k stars 128 forks source link

fb-adb shell sometimes fail with "shell: error in stub: fork: Try again" #64

Open eliasnaur opened 6 years ago

eliasnaur commented 6 years ago

In an attempt to work around https://issuetracker.google.com/issues/73230216, I replaced the use of adb with fb-adb in the supplied script

#!/bin/bash

while : ; do
        OUTPUT=$(fb-adb -e shell 'echo -n exitcode')
        if [[ ! "$OUTPUT" =~ "exitcode" ]]; then
                echo "invalid adb output: $OUTPUT"
                break
        fi
done

Then I started the emulator (an android-26 x86_64 image) and ran the 6 copies of the shell script. After a few minutes, fb-adb fails with:

fb-adb shell: error in stub: fork: Try again

tophyr commented 6 years ago

Interesting. Can you try with --transport=unix? By default fb-adb implicitly uses adb shell under the hood and sends data back and forth via stdin and stdout.

I would also be interested in results of the test using fb-adb rcmd instead of fb-adb shell.

eliasnaur commented 6 years ago

fb-adb -e shell --transport=unix 'echo -n exitcode' gives me:

fb-adb shell: unknown transport unix

The same happens with fb-adb -e rcmd --transport=unix .... Using plain fb-adb -e rcmd /system/bin/echo -n exitcode gives almost the same error as with fb-adb shell:

fb-adb rcmd: error in stub: fork: Try again

I'm on Fedora 27 if it helps.