Skip to content

"stdin is a console, aborting" when trying to read from stdin #2463

@KaMyKaSii

Description

@KaMyKaSii

Describe the bug
I am backing up my Android device (creating a tarball) and using zstd to compress it. I am using the commands adb exec-out (to send the output of the command on the Android device to the computer) and adb exec-in (to send the input on the computer to the commamd on the Android device). The problem is that zstd (in the device) can read from stdin during the backup/compress step but refuses to read during the restore/decompress. The same works correctly when using just tar or tar + pigz to compress and decompress.

To Reproduce
Steps to reproduce the behavior:

  1. Backup:
./adb exec-out "tar -cp /system/bin 2>/dev/null | pigz -1 -f" > system-bin.tar.gz (works)

./adb exec-out "tar -cp /system/bin 2>/dev/null | /data/adb/bin/zstd148 -3 -c" > system-bin.tar.zst (works)
  1. Restore:
./adb exec-in "pigz -d -f | tar -xp -C /cache 2>/dev/null" < system-bin.tar.gz (works)

./adb exec-in "/data/adb/bin/zstd148 -d -c 2>/cache/zstdlog.txt | tar -xp -C /cache 2>/dev/null" < system-bin.tar.zst (do not work)

The command ends instantly. Checking the zstdlog.txt file:
stdin is a console, aborting

Expected behavior
Just like tar or tar+pigz, read from stdin correctly.

Desktop (please complete the following information):

  • OS: Android
  • Version: 9
  • Compiler: Clang from Android NDK r22
  • Build system "make"

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions