Closed lasersPew closed 3 years ago
Installed applications:
Listing... Done apt/stable,now 2.3.6-1 arm [installed] bash/stable,now 5.1.8 arm [installed] binutils/stable,now 2.36.1 arm [installed,automatic] bzip2/stable,now 1.0.8-6 arm [installed] ca-certificates/stable,now 20210603 all [installed] clang/stable,now 12.0.0-1 arm [installed] command-not-found/stable,now 1.62 arm [installed] coreutils/stable,now 8.32-7 arm [installed] curl/stable,now 7.78.0 arm [installed] dash/stable,now 0.5.11.4 arm [installed] debianutils/stable,now 4.11.2 arm [installed] dialog/stable,now 1.3-20210621-0 arm [installed] diffutils/stable,now 3.7-3 arm [installed] dos2unix/stable,now 7.4.2 arm [installed] dpkg/stable,now 1.20.9-5 arm [installed] ed/stable,now 1.17 arm [installed] ffmpeg/stable,now 4.4 arm [installed] findutils/stable,now 4.8.0 arm [installed] fontconfig/stable,now 2.13.1-6 arm [installed,automatic] freetype/stable,now 2.11.0 arm [installed,automatic] fribidi/stable,now 1.0.10 arm [installed,automatic] game-repo/stable,now 2.0 all [installed] gawk/stable,now 5.1.0-1 arm [installed] gdbm/stable,now 1.19 arm [installed,automatic] giflib/stable,now 5.2.1-2 arm [installed,automatic] git/stable,now 2.32.0 arm [installed] glib/stable,now 2.66.1 arm [installed,automatic] gpgv/stable,now 2.3.1-1 arm [installed] grep/stable,now 3.6 arm [installed] gzip/stable,now 1.10-4 arm [installed] harfbuzz/stable,now 2.8.2 arm [installed,automatic] htop-legacy/stable,now 1:2.2.0 arm [installed] inetutils/stable,now 1.9.4-11 arm [installed] krb5/stable,now 1.19.1 arm [installed,automatic] ldns/stable,now 1.7.1-3 arm [installed,automatic] less/stable,now 563 arm [installed] libandroid-glob/stable,now 0.6-2 arm [installed] libandroid-support/stable,now 28 arm [installed] libass/stable,now 0.15.1 arm [installed,automatic] libassuan/stable,now 2.5.5 arm [installed] libbz2/stable,now 1.0.8-6 arm [installed] libc++/stable,now 21d-1 arm [installed] libcrypt/stable,now 0.2-3 arm [installed] libcurl/stable,now 7.78.0 arm [installed] libdav1d/stable,now 0.9.0 arm [installed,automatic] libdb/stable,now 18.1.40-2 arm [installed,automatic] libedit/stable,now 20210714-3.1-0 arm [installed,automatic] libffi/stable,now 3.3-2 arm [installed,automatic] libgcrypt/stable,now 1.9.3 arm [installed] libgmp/stable,now 6.2.1 arm [installed] libgnutls/stable,now 3.6.16 arm [installed] libgpg-error/stable,now 1.42 arm [installed] libgraphite/stable,now 1.3.14 arm [installed,automatic] libiconv/stable,now 1.16-3 arm [installed] libidn2/stable,now 2.3.2 arm [installed] libjpeg-turbo/stable,now 2.1.0 arm [installed,automatic] libllvm/stable,now 12.0.0-1 arm [installed,automatic] liblz4/stable,now 1.9.3 arm [installed] liblzma/stable,now 5.2.5-1 arm [installed] libmp3lame/stable,now 3.100-3 arm [installed,automatic] libmpfr/stable,now 4.1.0 arm [installed] libnettle/stable,now 3.7.3 arm [installed] libnghttp2/stable,now 1.44.0 arm [installed] libnpth/stable,now 1.6-1 arm [installed] libogg/stable,now 1.3.5 arm [installed,automatic] libopus/stable,now 1.3.1-4 arm [installed,automatic] libpng/stable,now 1.6.37-3 arm [installed,automatic] libprotobuf/stable,now 2:3.17.3 arm [installed,automatic] libsoxr/stable,now 0.1.3-2 arm [installed,automatic] libsqlite/stable,now 3.36.0 arm [installed,automatic] libssh2/stable,now 1.9.0-2 arm [installed] libtalloc/stable,now 2.3.3 arm [installed,automatic] libtiff/stable,now 4.3.0 arm [installed,automatic] libtirpc/stable,now 1.3.1 arm [installed] libunistring/stable,now 0.9.10-4 arm [installed] libuuid/stable,now 1.0.3-4 arm [installed,automatic] libvidstab/stable,now 1.1.0 arm [installed,automatic] libvorbis/stable,now 1.3.7 arm [installed,automatic] libvpx/stable,now 1.10.0 arm [installed,automatic] libwebp/stable,now 1.2.0 arm [installed,automatic] libx264/stable,now 1:0.161.3049 arm [installed,automatic] libx265/stable,now 3.3 arm [installed,automatic] libxml2/stable,now 2.9.12 arm [installed,automatic] libyaml/stable,now 0.2.5-4 arm [installed,automatic] lsof/stable,now 4.94.0 arm [installed] make/stable,now 4.3-1 arm [installed] mosh/stable,now 1.3.2-29 arm [installed] nano/stable,now 5.8 arm [installed] ncurses-ui-libs/stable,now 6.2.20200725-4 arm [installed,automatic] ncurses/stable,now 6.2.20200725-4 arm [installed] ndk-sysroot/stable,now 21d-2 arm [installed,automatic] net-tools/stable,now 2.10.0 arm [installed] openssh/stable,now 8.6p1 arm [installed] openssl/stable,now 1.1.1k-2 arm [installed] patch/stable,now 2.7.6-3 arm [installed] pcre2/stable,now 10.37 arm [installed,automatic] pcre/stable,now 8.45 arm [installed] pkg-config/stable,now 0.29.2 arm [installed,automatic] procps/stable,now 3.3.17-1 arm [installed] proot/stable,now 5.1.107-40 arm [installed] psmisc/stable,now 23.4 arm [installed] python/stable,now 3.9.6-1 arm [installed] readline/stable,now 8.1.1 arm [installed] ruby/stable,now 3.0.2-1 arm [installed] science-repo/stable,now 2.0 all [installed] sed/stable,now 4.8-1 arm [installed] tar/stable,now 1.34 arm [installed] termux-am/stable,now 0.4 all [installed] termux-auth/stable,now 1.4 arm [installed,automatic] termux-exec/stable,now 1:0.9 arm [installed] termux-keyring/stable,now 1.9 all [installed] termux-licenses/stable,now 2.0-1 all [installed] termux-tools/stable,now 0.130 all [installed] ttf-dejavu/stable,now 2.37-8 all [installed,automatic] unzip/stable,now 6.0-7 arm [installed] util-linux/stable,now 2.37 arm [installed] wget/stable,now 1.21.1 arm [installed] xvidcore/stable,now 1.3.7 arm [installed,automatic] xxhash/stable,now 0.8.0-1 arm [installed] xz-utils/stable,now 5.2.5-1 arm [installed] zip/stable,now 3.0-5 arm [installed] zlib/stable,now 1.2.11-5 arm [installed] zsh/stable,now 5.8-6 arm [installed]
And Here is my python modules installed:
beautifulsoup4==4.9.3 certifi==2021.5.30 charset-normalizer==2.0.3 colorama==0.4.4 commonmark==0.9.1 idna==3.2 mutagen==1.45.1 Pygments==2.9.0 pytube==10.9.3 rapidfuzz==1.4.1 requests==2.26.0 rich==10.6.0 six==1.16.0 soupsieve==2.2.1 spotdl==3.6.2 spotipy==2.18.0 tqdm==4.61.2 Unidecode==1.2.0 urllib3==1.26.6 youtube-dl==2021.6.6 ytmusicapi==0.18.0
gitstatusd doesn't work on some devices running Termux. I don't know why or how those devices are different from the ones that can run gitstatusd. Other reports of the same error:
If you figure out anything related to this issue, please post a comment.
I guess bad address
is related to SELinux running in Enforcing mode. SELinux mode is usually picked by phone vendor. Termux somehow manages to workaround this for its own packaged binaries, but not for any binary under any path.
@z0rc Thanks! That could be it.
@lasersPew Let's check this hypothesis. Please run the following command (copy-paste it into zsh prompt) and post its complete output:
() {
emulate -L zsh -o xtrace
local dir
{
dir=$(mktemp -d) || return
>$dir/test.c <<<'int main() {}' || return
cc -o $dir/test $dir/test.c || return
$dir/test || return
print success
} always {
rm -rf -- "$dir"
}
}
If it says that cc
command is not found, install clang with apt install clang
and try again.
Here it is:
+(anon):2> local dir
+(anon):4> dir=+(anon):4> mktemp -d
+(anon):4> dir=/data/data/com.termux/files/usr/tmp/tmp.jUkXezhWvn
+(anon):5> cat
+(anon):6> cc -o /data/data/com.termux/files/usr/tmp/tmp.jUkXezhWvn/test /data/data/com.termux/files/usr/tmp/tmp.jUkXezhWvn/test.c
+(anon):7> /data/data/com.termux/files/usr/tmp/tmp.jUkXezhWvn/test
+(anon):8> print success
success
+(anon):10> rm -rf -- /data/data/com.termux/files/usr/tmp/tmp.jUkXezhWvn
If execve()
was restricted by SELinux, the above test would've failed. I think. So "bad address" must be caused by something else, or maybe I'm misunderstanding things.
I googled around a bit and it seems like this error can pop up if you are using a 64-bit kernel with a 32-bit userspace. If you were using such a system, gitstatus would (erroneously) try to use gitstatusd-linux-aarch64
, which is compiled for 64-bit kernel and 64-bit userspace. This would cause userspace/kernel data size mismatch and result in the above error.
@lasersPew Let's try this:
() {
emulate -L zsh -o xtrace
local dir
{
dir=$(mktemp -d) || return
>$dir/test.c <<<'#include <stdio.h>
int main() {
printf("%d\n", (int)sizeof(void*));
}' || return
cc -o $dir/test $dir/test.c || return
$dir/test || return
print success
} always {
rm -rf -- "$dir"
}
}
What's the output?
Here:
+(anon):2> local dir
+(anon):4> dir=+(anon):4> mktemp -d
+(anon):4> dir=/data/data/com.termux/files/usr/tmp/tmp.IJfSyLFt6d
+(anon):5> cat
+(anon):9> cc -o /data/data/com.termux/files/usr/tmp/tmp.IJfSyLFt6d/test /data/data/com.termux/files/usr/tmp/tmp.IJfSyLFt6d/test.c
+(anon):10> /data/data/com.termux/files/usr/tmp/tmp.IJfSyLFt6d/test
4
+(anon):11> print success
success
+(anon):13> rm -rf -- /data/data/com.termux/files/usr/tmp/tmp.IJfSyLFt6d
Yep, that's it. 64 bit kernel with 32 bit userspace.
What device is this and what's the version of Android?
Samsung Galaxy J7 Pro(2017) Android 9
Thanks.
Ideally I would need to provide yet another binary for a platform like this. Realistically, I won't get around to doing that. 32-bit will likely disappear in the future and together with it the need for a 32 binary. Plus, I expect that gitstatusd will stop working altogether in Android 12 due to the changes in the default SELinux policy.
You can try compiling gitstatusd manually. Something like this:
apt install -y make clang cmake curl
cd ~/.oh-my-zsh/custom/themes/powerlevel10k/gitstatus
./build -w
If this works, great! Note that you'll need to do this whenever you start getting errors from gitstatus after updating powerlevel10k.
Tried this, but seems termux uses lld instead of ld, so it fails when running ./build -w
Ok I setted this at the end of my .zshrc and at least now there is no error.
POWERLEVEL9K_DISABLE_GITSTATUS=true
POWERLEVEL9K_VCS_BACKENDS=()
The second line was also necessary to shut up some other error messages. Everything else seems to work fine.
I've received some errors while using zsh and p10k. Here it is:
` [powerlevel10k] fetching gitstatusd .. / [ERROR]: gitstatus failed to initialize.
Zsh log (/data/data/com.termux/files/usr/tmp/gitstatus.POWERLEVEL9K.10299.12358.1627265227.2.xtrace.log):
Daemon log (/data/data/com.termux/files/usr/tmp/gitstatus.POWERLEVEL9K.10299.12358.1627265227.2.daemon.log):
System information:
`