termux / proot

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

proot crashes #46

Closed fornwall closed 4 years ago

fornwall commented 5 years ago

From @Rudloff on October 20, 2018 20:38

Hello,

When I launch proot 5.1.107-18, it fails immediately with this error:

proot info: vpid 1: terminated with signal 7

Here is my setup:

Updatable packages:
All packages up to date
System information:
Linux localhost 3.4.0-perf-g51517f90280 #1 SMP PREEMPT Mon Oct 15 16:48:46 UTC 2018 armv7l Android
Termux-packages arch:
arm
Android version:
7.1.2
Device manufacturer:
Fairphone
Device model:
FP2

Copied from original issue: termux/termux-packages#2972

michalbednarski commented 5 years ago

In order to check what's going on I'd need at least some logs, please run with PROOT_VERBOSE=9 environment variable set (Output is written to stderr)

/cc @Rudloff

Rudloff commented 5 years ago

Here is the full output: https://gist.github.com/Rudloff/ad48871270d50454bce17715827b69f4

michalbednarski commented 5 years ago

Unfortunately log didn't help me identify what went wrong. I've also tried replacing /system in emulator with one from Fairphone image but still didn't reproduce (which isn't surprising as most problems with proot are kernel-related). Try running with PROOT_NO_SECCOMP=1 env variable set. If still didn't work I'd ask for trace from:

env PROOT_NO_SECCOMP=1 PROOT_VERBOSE=9 strace -vs5000 -o trace.txt termux-chroot
Rudloff commented 5 years ago

Unfortunately, PROOT_NO_SECCOMP=1 does not seem to work.

Here is the trace: https://gist.github.com/Rudloff/20c72f470c9835a68df3b8d59d856150

michalbednarski commented 5 years ago

Looks like strace didn't work here as well (strace'd termux-chroot wrapper script crashed at startup before even launching proot).

This probably means chances of getting proot work on this device are slim as strace similarly to proot breaks on syscalls, but unlike proot it doesn't write tracee registers/memory, yet that was sufficient to clobber process state. (by looking in your trace and comparing that to getentropy function in libc.so from Fairphone image it looks like r6 which was holding file descriptor for /dev/urandom was clobbered with 1 during fstat64 call (line 35 in trace)

This is similar to https://github.com/termux/proot/issues/12#issuecomment-428155618

I don't think this will be possible to work around, sorry

oxr463 commented 5 years ago

This is likely due to this, https://github.com/proot-me/proot/issues/75

pngwen commented 5 years ago

I am also having this problem. For me, it started with the latest update to my phone's os. I had several working chroots, but now proot always crashes. I had Alpine, arch, and Debian all going. Now none work.

This is Android 8.1 with patch level June 1, 2019 on an LG Stylo 4 plus.

Rudloff commented 4 years ago

I still get this error on Lineage 17.1, so you are probably right about it being kernel-related.

Rudloff commented 4 years ago

Lineage recently updated the FP kernel to 3.4.113 and now proot works. So I guess this can be closed.