Closed sehugg closed 6 years ago
Are all packages up to date?
Could you share the full strace log?
As of the latest coreutils
update I'm experiencing the same issue on an arm
device:
$ termux-info
Updatable packages:
All packages up to date
System information:
Linux localhost 3.4.113-lineageos-g31d25d7 #1 SMP PREEMPT Sat Jun 23 16:51:30 CEST 2018 armv7l Android
Termux-packages arch:
arm
Android version:
7.1.2
Device manufacturer:
samsung
Device model:
SM-G900F
The output of strace
when running apt install coreutils
(yes, the error occurs even when installing the package itself) is here.
All packages are up-to-date.
I can confirm I have the same problem on my armv7 device.
u0_a91@localhost:~$ termux-info
Updatable packages:
All packages up to date
System information:
Linux localhost 3.4.113-lineageos-g8a3199a9a3f #1 SMP PREEMPT Mon Jun 18 15:15:27 CEST 2018 armv7l Android
Termux-packages arch:
arm
Android version:
8.1.0
Device manufacturer:
OnePlus
Device model:
A0001
after latest update there also get an apt-key
error:
Err:1 https://termux.net stable InRelease
Unknown error executing apt-key
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://termux.net stable InRelease: Unknown error executing apt-key
@arswb I don't see anything that indicate that the error is related. Try running apt update again.
just the same, I tried it a few times. and in the download process, my phone always vibrates. the download process also takes a long time. this is not about my network.
I can't reproduce the error on my arm android 7.1.2 device, so that's interesting. termux-info
output:
Updatable packages:
texlive-bin/stable 20180414-2 arm [upgradable from: 20180414]
System information:
Linux localhost 3.4.113-Deathly-1.0 #2 SMP PREEMPT Fri Feb 23 21:24:29 CET 2018 armv7l Android
Termux-packages arch:
arm
Android version:
7.1.2
Device manufacturer:
samsung
Device model:
SM-T800
@arswb what happens if you run apt-key
or apt-key adv --keyserver pgp.mit.edu --recv A46BE53C
?
(A46BE53C is my key).
when I do the termux-info command, it takes a long time, about half a minute, and my phone vibrates several times.
the output
$ termux-info
Updatable packages:
All packages up to date
System information:
Linux localhost 3.18.19-12327063 #1 SMP PREEMPT Thu Jun 7 09:58:59 KST 2018 armv7l Android
Termux-packages arch:
arm
Android version:
6.0.1
Device manufacturer:
samsung
Device model:
SM-G532G
``
@arswb Please open another issue as this might be unrelated to this issue.
i tried it
$ apt-key adv --keyserver pgp.mit.edu --recv A46BE53C
Segmentation fault
Segmentation fault
$
Alright, seems suspicious
Could someone run a segfault command in gdb and see if it gives any more information? (gdb --args faulty-command
followed by run and backtrace).
If rm is the only/one of few binaries that don't work then it should be possible to mv it temporarily using busybox: busybox mv $PREFIX/bin/rm $PREFIX/bin/rm_old
.
After you start a new shell apt and all other programs will then use the busybox version of rm instead of the broken one.
finally i downgrade coreutils package, i download it from xeffyr repo and yes, everything is back to normal.
this is a problem? @Grimler91
(gdb) file /data/data/com.termux/files/usr/bin/apt-key
"/data/data/com.termux/files/usr/bin/apt-key": not in executable format: File format not recognized
@arswb no, that means that the file apt-key isn't a binary file and gdb therefore can't attach to it. It is apparently a bash script, so this is the expected behaviour.
@Grimler91 sorry, i'm not understand about that. :rofl:
I am also having the same problems.
$ termux-info Updatable packages: All packages up to date System information: Linux localhost 3.10.108-lineageOS #1 SMP PREEMPT Wed Jun 27 10:16:07 UTC 2018 armv7l Android Termux-packages arch: arm Android version: 7.1.2 Device manufacturer: Motorola Device model: Moto G4 Plus
gdb --args rm: (gdb) run Starting program: /data/data/com.termux/files/usr/bin/rm /data/data/com.termux/files/usr/bin/rm: missing operand Try '/data/data/com.termux/files/usr/bin/rm --help' for more information.
Program received signal SIGSEGV, Segmentation fault. 0x7f5df1d0 in ?? () (gdb) bt
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
I just updated to the latest Termux beta 0.64. Coreutils packages are crashing, Erlang crashes, and I get the same key errors detailed above.
System information: Linux localhost 3.18.0-18034-g6bbde26a08bb #1 SMP PREEMPT Tue Jun 26 12:28:26 PDT 2018 i686 Android Termux-packages arch: i686 Android version: 7.1.1 Device manufacturer: google Device model: ASUS Chromebook Flip C302 Package: coreutils Version: 8.30 Maintainer: Fredrik Fornwall @fornwall Installed-Size: 1528 kB Homepage: https://www.gnu.org/software/coreutils/ Download-Size: 426 kB APT-Manual-Installed: yes APT-Sources: https://termux.net stable/main i686 Packages Description: Basic file, shell and text manipulation utilities from the GNU project
Package: erlang Version: 21.0.1 Maintainer: Fredrik Fornwall @fornwall Installed-Size: 99.6 MB Depends: openssl, ncurses, libutil Homepage: https://www.erlang.org/ Download-Size: 33.2 MB APT-Manual-Installed: yes APT-Sources: https://termux.net stable/main i686 Packages Description: General-purpose concurrent functional programming language developed by Ericsson
% rm rm: missing operand Try 'rm --help' for more information. [1] 26754 segmentation fault (core dumped) rm
% erl
erl_child_setup closed
Crash dump is being written to: erl_crash.dump...done
% pkg update Hit:1 https://termux.net stable InRelease Err:1 https://termux.net stable InRelease Unknown error executing apt-key Reading package lists... Done Building dependency tree Reading state information... Done All packages are up to date. W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://termux.net stable InRelease: Unknown error executing apt-key W: Failed to fetch https://termux.net/dists/stable/InRelease Unknown error executing apt-key W: Some index files failed to download. They have been ignored, or old ones used instead. Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
I have very similar issues on Android 5.1:
rm
segfaultsapt update
returns the same output as in the post above by @josephbreihan mv
segfaultsapt-key adv --keyserver pgp.mit.edu --recv A46BE53C
returns Segmentation fault
twice, as in the post above by @arswb When this started happening I did a clean install. All was fine until I installed coreutils; that's when I first got the killed-by-signal error during the dpkg cleanup.
Before installing coreutils I installed other packages successfully and without issue, like emacs and git, and upgraded dpkg, also without problems (that was the first reported update after the fresh termux install).
Program received signal SIGSEGV, Segmentation fault. 0x7f5e46be in freadahead (fp=0xb6f48788 <__sF>) at /home/builder/.termux-build/coreutils/src/lib/freadahead.c:51 51 /home/builder/.termux-build/coreutils/src/lib/freadahead.c: No such file or directory. (gdb) bt
(gdb)
I'd also like to confirm that the (temporary) solution proposed by @arswb works in a pinch, until the dust settles on this:
There is a copy of v. 8.29 of the coreutils package in the arm branch of the xeffyr repo.
okay iv got it working ... lib/closein.c if (freadahead (stdin) > 0) { / Only attempt flush if stdin is seekable, as fflush is entitled to fail on non-seekable streams. / if (fseeko (stdin, 0, SEEK_CUR) == 0 && fflush (stdin) != 0) fail = true; } this doesn't work on 32bit.
what i think the issue is the difference between versions 2.29 and 2.30 is this addition to stdio-impl.h / Up to this commit from 2015-10-12 https://android.googlesource.com/platform/bionic.git/+/f0141dfab10a4b332769d52fa76631a64741297a the innards of FILE were public, and fp_ub could be defined like for OpenBSD, see https://android.googlesource.com/platform/bionic.git/+/e78392637d5086384a5631ddfdfa8d7ec8326ee3/libc/stdio/fileext.h and https://android.googlesource.com/platform/bionic.git/+/e78392637d5086384a5631ddfdfa8d7ec8326ee3/libc/stdio/local.h. After this commit, the innards of FILE are hidden. /
int _r; \
int _w; \
int _flags; \
int _file; \
struct { unsigned char *_base; size_t _size; } _bf; \
int _lbfsize; \
void *_cookie; \
void *_close; \
void *_read; \
void *_seek; \
void *_write; \
struct { unsigned char *_base; size_t _size; } _ext; \
unsigned char *_up; \
int _ur; \
unsigned char _ubuf[3]; \
unsigned char _nbuf[1]; \
struct { unsigned char *_base; size_t _size; } _lb; \
int _blksize; \
fpos_t _offset; \
/* More fields, not relevant here. */ \
} *) fp)
That code was introduced to gnulib in 2007 and used in coreutils 8.29 anyway. http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commit;h=7042775894700f8be0e6bc2a5ff3c49fc77296bc
Something to do with the recent NDK upgrade / clang switch?
no 2.29 still compiles and works fine
` return fp_->_r
Is the line it crashes on. Its the changes in stdio-impl.h with android. HASUB is defined there. It used to be android got the same treatment as BSD but its changed here.
the innards of FILE were public, and fp_ub could be defined like for OpenBSD,
this change is the cause as far I can work out.
So yeah https://android.googlesource.com/platform/bionic.git/+/f0141dfab10a4b332769d52fa76631a64741297a/libc/stdio/local.h Bionic libc hides symbols in 64bit so its appropriate to use the new stdio-impl.h but it doesn't hide them for 32bit.
Is any of the headers you mentioned so far part of the API/NDK?
Suppose NDK 17 ships a broken version bionic build, could it possibly break a program build when it was just being linked against during the build process? I don't suppose the reporters all happened to have upgraded to the broken bionic (i.e. Android upgrade) recently?
no 2.29 still compiles and works fine
What do you mean by this? Were you actually referring to coreutils 8.29? You mean its build with NDK 17 and clang works? Then it should be some changes in 8.30 causing/triggering it?
Has anyone tested a build of coreutils 8.30 with NDK 16 and/or gcc?
I tried with gcc and gcc 8 and all segfault
2.29 works everytime on all compilers i have.
https://github.com/its-pointless/gcc_termux/ Debug versions with fix just uploaded....
Maybe it's because the struct in the new stdio-impl.h in coreutils doesn't have special handle for __LP64__
like the one in local.h in bionic? (Hence if the bionic in a certain Android build is built with __LP64__
defined there wouldn't be a problem?)
...
struct __sbuf {
unsigned char* _base;
#if defined(__LP64__)
size_t _size;
#else
int _size;
#endif
};
struct __sFILE {
unsigned char* _p; /* current position in (some) buffer */
int _r; /* read space left for getc() */
int _w; /* write space left for putc() */
#if defined(__LP64__)
int _flags; /* flags, below; this FILE is free if 0 */
int _file; /* fileno, if Unix descriptor, else -1 */
#else
short _flags; /* flags, below; this FILE is free if 0 */
short _file; /* fileno, if Unix descriptor, else -1 */
#endif
...
Btw better file a bug report upstream...
I can repro, arm 32 bit Moto E4. Does anyone know how to downgrade?
Maybe downgrade in the repository?
This has now been fixed in version 8.30-1
of the coreutils package, which is available for installation.
@tomty89 or @its-pointless Can you submit a bug report/patch upstream? For the moment I just disabled their definition in 86af1159d0d487368aab2494904e89b86f042fe2, as Termux already has patched that in.
@sstt011:
I seem to be 32 bit too (uname -m
returns armv7l). I managed to downgrade to 8.29 as indicated briefly in my previous message in this thread and the post by @arswb (the one that mentions downgrading). In more detail:
apt purge coreutils
on the device, in termuxdpkg -i <path/to/coreutils_8.29_arm.deb>
How can I update to 8.30-1
if apt update isn't working just apt remove coreutils apt update apt install coreutils
This is just to confirm that the upgrade to 8.30-1 went through all right here (Android 5.1 on armv7l). No trace of the issues from before.
After upgrading the Termux app and doing a
pkg update
, mv now returns the following:This happened sometime during the upgrade and it borked many install scripts.
pkg reinstall coreutils
did not seem to remedy the situation.I'm not the best interpreter of strace logs but here are some lines:
termux-info: