termux / proot

An chroot-like implementation using ptrace.
https://wiki.termux.com/wiki/PRoot
Other
775 stars 160 forks source link

proot info: vpid 1: terminated with signal 4 #195

Open morealternative opened 3 years ago

morealternative commented 3 years ago
SDRausty commented 3 years ago

proot info: vpid 1: terminated with signal 4 error

Please share proot --verbose=2 output.

morealternative commented 3 years ago
proot info: binding = /
proot info: vpid 1: translate("/" + "/bin/sh")
proot error: '/bin/sh' not found (root = /, cwd = /data/data/com.termux/files/home/randomtrash/proot-distro, $PATH=(null))
fatal error: see `proot --help`.
morealternative commented 3 years ago

so when i will get answer ?

SDRausty commented 3 years ago

so when i will get answer ?

I have been waiting for a software resolution for about one year now; Your best bet is to upgrade to a new device with full 64bit architecture;e.g., aarch64 armv8

Do NOT buy a mixed 32/64 bit architecture device to try to resolve this issue immediatly, as there are known problems with mixed architecture devices. There might be a mobile store nearby with a free 64bit smartphone where you live if you transfer mobile service.

ZhymabekRoman commented 3 years ago

Do NOT buy a mixed 32/64 bit architecture device to try to resolve this issue immediatly, as there are known problems with mixed architecture devices.

What do you mean mixed device architecture? So historically, 64 bit processes have backward compatibility with 32 ABI

SDRausty commented 3 years ago

What do you mean mixed device architecture?

Hopefully, these quotes will answer:

Have you read up on the 32 64 bit mixed architecture issues at Termux? There are a few in temux-app and termux-packages.

Never before, are there references?

https://github.com/termux/termux-app/issues?q=is%3Aissue+32+64+bit+architecture

https://github.com/termux/termux-packages/issues?q=is%3Aissue+32+64+bit+architecture

Originally posted by @SDRausty in https://github.com/SDRausty/TermuxArch/issues/128#issuecomment-427883297

morealternative commented 3 years ago

so when i will get answer ?

I have been waiting for a software resolution for about one year now; Your best bet is to upgrade to a new device with full 64bit architecture;e.g., aarch64 armv8

Do NOT buy a mixed 32/64 bit architecture device to try to resolve this issue immediatly, as there are known problems with mixed architecture devices. There might be a mobile store nearby with a free 64bit smartphone where you live if you transfer mobile service.

but my phone architecture is aarch64

ghost commented 3 years ago

What do you mean mixed device architecture?

There are devices with AArch64 CPU, but operating system is 32bit only for certain reasons (e.g. small system partition that can hold only one set of native libs). On these devices uname -m reports armv8l.

SDRausty commented 3 years ago

uname -m

getprop | grep -e 32 -e 64

ZhymabekRoman commented 3 years ago

There are devices with AArch64 CPU, but operating system is 32bit only for certain reasons (e.g. small system partition that can hold only one set of native libs). On these devices uname -m reports armv8l.

Ahhhh, thanks, now I get it. I'm using just such a device, but I haven't noticed any problems with the proot or Termux

SDRausty commented 3 years ago

Distro Name: ArchLinux Distro Architecture: x86_64 Architecture: aarch64 phone architecture is aarch64

Is the result any better with the following command after choosing option x86_64: setupTermuxArch qemu?

If the result is NOT any better, then please share setupTermuxArch sysinfo information from the device that you are using.

SDRausty commented 3 years ago

haven't noticed any problems with the proot or Termux

uname -m?

ZhymabekRoman commented 3 years ago

Screenshot_20211002_163631

SDRausty commented 3 years ago

Thank you for sharing.

I have been waiting for a software resolution for about one year now;

The error proot info: vpid 1: terminated with signal 11 occurs on dpkg --print-architecture: arm, and uname -m: armv7l in my experience. Hence the resolution I am waiting for seems a little different from op's error.

ghost commented 3 years ago

This error happens on package compiled for arm. It doesn't matter whether device is armv7l or armv8l - both use arm 32 bit packages.

IMO, the signal 4 error comes from qemu-x86_64 (considering OP's configuration) and not from proot.

michalbednarski commented 3 years ago

Ok, looks like there's a clash between qemu binary and proot loader. I think I'll change proot to skip use of proot loader when using qemu

SDRausty commented 3 years ago

clash between qemu binary and proot loader.

For the most part, 64bit works very well with and without qemu support; 32bit is good too on all devices with the exception of proot with qemu on some 32bit devices; I will glad to help debug:

proot info: vpid 1: terminated with signal 11 occurs on dpkg --print-architecture: arm, and uname -m: armv7l

I would like to see how x86 behaves on this type of device; What should be done next to help debug proot with qemu on armv7l?

SDRausty commented 3 years ago

proot info: vpid 1: terminated with signal 11

exec proot --verbose=2 --kernel-release=4.9.190 --kill-on-exit --sysvipc --link2symlink -0 -r /data/data/com.termux/files/home/x8 -q /data/data/com.termux/files/usr/bin/qemu-i386 -b /apex -b /storage  -b /sys -b /system -b /vendor -b /dev/ashmem:/dev/ashmem -b /proc/:/proc/ -b /proc/self/fd/2:/dev/stderr -b /proc/self/fd/1:/dev/stdout -b /proc/self/fd/0:/dev/stdin -b /dev/urandom:/dev/random -b /data/data/com.termux/files/usr:/data/data/com.termux/files/usr -b /proc/self/fd:/dev/fd -b /data/data/com.termux/files/home:/data/data/com.termux/files/home -b /dev/:/dev/ -b /data/data/com.termux/files/home/x8/var/binds/fbindprocuptime:/proc/uptime -b /data/data/com.termux/files/home/x8/tmp:/dev/shm -b /data/data/com.termux/files/home/x8/var/binds/fbindprocstat:/proc/stat -b /data/data/com.termux/files/usr/tmp:/tmp -w /root /usr/bin/env -i HOME=/root TERM="xterm-256color" TMPDIR=/tmp ANDROID_DATA=/data  /bin/bash -l
proot info: binding = /data/data/com.termux/files/usr/tmp:/tmp
proot info: binding = /data/data/com.termux/files/home/x8/var/binds/fbindprocstat:/proc/stat
proot info: binding = /data/data/com.termux/files/home/x8/tmp:/dev/shm
proot info: binding = /data/data/com.termux/files/home/x8/var/binds/fbindprocuptime:/proc/uptime
proot info: binding = /data/data/com.termux/files/home
proot info: binding = /data/data/com.termux/files/usr
proot info: binding = /dev/urandom:/dev/random
proot info: binding = /dev/pts/22:/proc/17422/fd/0
proot info: binding = /dev/pts/22:/proc/17422/fd/1
proot info: binding = /dev/pts/22:/proc/17422/fd/2
proot info: binding = /proc/17422/fd
proot info: binding = /proc
proot info: binding = /dev/ashmem
proot info: binding = /dev
proot info: binding = /vendor
proot info: binding = /system
proot info: binding = /sys
proot info: binding = /storage
proot info: binding = /apex
proot info: binding = /dev/null:/etc/ld.so.preload
proot info: binding = /:/host-rootfs
proot info: binding = /data/data/com.termux/files/home/x8:/
proot info: vpid 1: translate("/" + "/usr/bin/env")
proot info: vpid 1:          -> "/data/data/com.termux/files/home/x8/usr/bin/env"
proot info: vpid 1: translate("/" + "/usr/bin/env")
proot info: vpid 1:          -> "/data/data/com.termux/files/home/x8/usr/bin/env"
proot info: host rootfs = /host-rootfs
proot info: glue rootfs = /data/data/com.termux/files/usr/tmp/proot-17422-DkvFzD
proot info: exe = /usr/bin/env
proot info: argv = /usr/bin/env -i HOME=/root TERM=xterm-256color TMPDIR=/tmp ANDROID_DATA=/data /bin/bash -l
proot info: qemu = /data/data/com.termux/files/usr/bin/qemu-i386
proot info: initial cwd = /root
proot info: verbose level = 2
proot info: pid 17422: access to "/dev/pts/22" (fd 0) won't be translated until closed
proot info: pid 17422: access to "/dev/pts/22" (fd 1) won't be translated until closed
proot info: pid 17422: access to "/dev/pts/22" (fd 2) won't be translated until closed
proot info: pid 17422: access to "/proc/17422/fd" (fd 3) won't be translated until closed
proot info: vpid 1: translate("/" + "/usr/bin/env")
proot info: vpid 1:          -> "/data/data/com.termux/files/home/x8/usr/bin/env"
proot info: vpid 1: translate("/" + "/host-rootfs/system/bin/linker")
proot info: vpid 1:          -> "/apex/com.android.runtime/bin/linker"
proot info: ptrace acceleration (seccomp mode 2, new syscall order) enabled
proot info: vpid 1: translate("/" + "/host-rootfs/data/data/com.termux/files/usr/bin/qemu-i386")
proot info: vpid 1:          -> "/data/data/com.termux/files/usr/bin/qemu-i386"
proot info: vpid 1: translate("/" + "/usr/bin/env")
proot info: vpid 1:          -> "/data/data/com.termux/files/home/x8/usr/bin/env"
proot info: vpid 1: terminated with signal 11
proot info: terminating all tracees on exit
michalbednarski commented 3 years ago

Fixed version should soon be available in Termux apt as proot_5.1.107-45

AarizYT commented 3 years ago

Still getting the error with the latest PRoot. After logging into an Arch Linux x86_64 PRoot container, executing uname twice returns this error: talloc: access after free error - first free may be at ./execve/enter.c:661 Bad talloc magic value - access after free proot warning: signal 6 received from process 16991

SDRausty commented 3 years ago

error with the latest PRoot. After logging into an Arch Linux x86_64 PRoot container

dpkg --print-architecture getprop | grep -e 32 -e 64 uname -m

What is the device architecture?

SDRausty commented 3 years ago

executing uname twice returns this error

grep ame .bashrc
alias UM='uname -m'
alias Um='uname -m'
alias um='uname -m'

I cannot reproduce this error.

AarizYT commented 3 years ago

Here's the output: aarch64

`[cache_key.display_info]: [7323236010928765824]

aarch64

I tested a bit more and it seems that even pacman returns the same error. PRoot-Distro has stopped working (with qemu-user-x86-64) since the PRoot commit on 26th September. I get this error when I try to login into an Arch Linux x86_64 PRoot container using PRoot-Distro: proot info: vpid 1: terminated with signal 4

SDRausty commented 3 years ago

Thank you for sharing

proot info: vpid 1: terminated with signal 4

Can you also share proot --verbose=2 output?

SDRausty commented 3 years ago

so when i will get answer ?

@morealternative does the update resolve the error?

@AarizYT ensure that everything is up to date as @michalbednarski has created https://github.com/termux/termux-packages/commit/a5cc417d8de92db5efcd1525193409d388455a5c which resolves proot info: vpid 1: terminated with signal 11 and sudo; Thank you 🎵 🎶

pikriawan commented 3 weeks ago
DISTRO_ARCH=x86_64 proot-distro login archlinux