-
-
Notifications
You must be signed in to change notification settings - Fork 581
Description
Read the FAQ first
- I have checked the FAQ but the issue is not covered
Description
Hi, I wanted to let you know that unfortunately, after commit 822ddc6, on some devices fastfetch
version 2.53.0 is having a crash!
Thread 1 "fastfetch" received signal SIGSYS, Bad system call.
0x0000007fb68ce340 in syscall () from /apex/com.android.runtime/lib64/bionic/libc.so
(gdb) bt
#0 0x0000007fb68ce340 in syscall () from /apex/com.android.runtime/lib64/bionic/libc.so
#1 0x00000055556910d8 in detectStats (disk=0x7fb6225000)
at /home/builder/.termux-build/fastfetch/src/src/detection/disk/disk_linux.c:272
#2 ffDetectDisksImpl (options=0x7fffffe7a8, disks=<optimized out>, disks@entry=0x7fffffe2c0)
at /home/builder/.termux-build/fastfetch/src/src/detection/disk/disk_linux.c:321
#3 0x000000555560d3c0 in ffDetectDisks (options=0x7fffffe7a8, disks=disks@entry=0x7fffffe2c0)
at /home/builder/.termux-build/fastfetch/src/src/detection/disk/disk.c:10
#4 0x000000555562d584 in ffPrintDisk (options=0x7fffffe7a8)
at /home/builder/.termux-build/fastfetch/src/src/modules/disk/disk.c:192
#5 0x0000005555601e88 in parseStructureCommand (line=0x7fb621f28d "Disk",
fn=fn@entry=0x5555601ef8 <genJsonResult>, jsonDoc=jsonDoc@entry=0x0)
at /home/builder/.termux-build/fastfetch/src/src/common/commandoption.c:162
#6 0x0000005555601bf0 in ffPrintCommandOption (data=data@entry=0x7fffffe9d0, jsonDoc=0x0)
at /home/builder/.termux-build/fastfetch/src/src/common/commandoption.c:186
#7 0x00000055556d5e44 in run (data=0x7fffffe9d0)
at /home/builder/.termux-build/fastfetch/src/src/fastfetch.c:768
#8 main (argc=1, argv=<optimized out>) at /home/builder/.termux-build/fastfetch/src/src/fastfetch.c:837
(gdb)
termux-info
of an affected device:
Termux Variables:
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP__APK_FILE=/data/app/com.termux-dZ8UnEaeiwmdr1f5FuZUVA==/base.apk
TERMUX_APP__APK_RELEASE=F_DROID
TERMUX_APP__APP_VERSION_CODE=1022
TERMUX_APP__APP_VERSION_NAME=0.119.0-beta.3
TERMUX_APP__DATA_DIR=/data/user/0/com.termux
TERMUX_APP__IS_DEBUGGABLE_BUILD=false
TERMUX_APP__IS_INSTALLED_ON_EXTERNAL_STORAGE=false
TERMUX_APP__LEGACY_DATA_DIR=/data/data/com.termux
TERMUX_APP__PACKAGE_NAME=com.termux
TERMUX_APP__PID=8699
TERMUX_APP__SE_FILE_CONTEXT=u:object_r:app_data_file:s0:c33,c257,c512,c768
TERMUX_APP__SE_INFO=untrusted:targetSdkVersion=28:complete
TERMUX_APP__TARGET_SDK=28
TERMUX_VERSION=0.119.0-beta.3
TERMUX__APPS_DIR=/data/user/0/com.termux/termux/apps
TERMUX__HOME=/data/data/com.termux/files/home
TERMUX__PREFIX=/data/data/com.termux/files/usr
TERMUX__ROOTFS_DIR=/data/data/com.termux/files
TERMUX__SE_PROCESS_CONTEXT=u:r:untrusted_app_27:s0:c33,c257,c512,c768
TERMUX__UID=10289
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://packages.termux.dev/apt/termux-main stable main
# x11-repo (sources.list.d/x11.list)
deb https://packages.termux.dev/apt/termux-x11 x11 main
Updatable packages:
All packages up to date
termux-tools version:
1.45.0
Android version:
10
Kernel build information:
Linux localhost 4.9.186-22990479 #1 SMP PREEMPT Thu Feb 24 18:21:21 KST 2022 aarch64 Android
Device manufacturer:
samsung
Device model:
SM-G960U
Supported ABIs:
SUPPORTED_ABIS: arm64-v8a,armeabi-v7a,armeabi
SUPPORTED_32_BIT_ABIS: armeabi-v7a,armeabi
SUPPORTED_64_BIT_ABIS: arm64-v8a
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec-ld-preload.so
Installed termux plugins:
com.termux.api versionCode:1001
com.termux.x11 versionCode:15
I tested reverting 822ddc6 like this, and I can let you know that I can confirm, for example, that just reverting this temporarily does make the crash stop happening, but, of course, I would never attempt to place a patch like this into a downstream distributed package of fastfetch
, instead, I will report all bugs here so that you can be completely aware and so that you can decide what the best possible way to fix the problem is and place it upstream only!
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1306,6 +1306,9 @@ check_function_exists(wcwidth HAVE_WCWIDTH)
if(NOT HAVE_WCWIDTH)
list(APPEND LIBFASTFETCH_SRC src/util/wcwidth.c)
endif()
+if(LINUX)
+ check_function_exists(statx HAVE_STATX)
+endif()
if(NOT WIN32)
check_function_exists(pipe2 HAVE_PIPE2)
endif()
@@ -1421,6 +1424,10 @@ if(FreeBSD OR OpenBSD OR NetBSD)
unset(CMAKE_REQUIRED_DEFINITIONS)
endif()
+if(HAVE_STATX)
+ target_compile_definitions(libfastfetch PUBLIC FF_HAVE_STATX)
+endif()
+
if(HAVE_WCWIDTH)
target_compile_definitions(libfastfetch PUBLIC FF_HAVE_WCWIDTH)
endif()
--- a/src/detection/disk/disk_linux.c
+++ b/src/detection/disk/disk_linux.c
@@ -10,10 +10,6 @@
#include <sys/stat.h>
#include <sys/statvfs.h>
-#ifdef STATX_BTIME
- #include <sys/syscall.h>
-#endif
-
#ifdef __USE_LARGEFILE64
#define stat stat64
#define statvfs statvfs64
@@ -267,9 +263,9 @@ static void detectStats(FFDisk* disk)
}
disk->createTime = 0;
- #ifdef SYS_statx
+ #ifdef FF_HAVE_STATX
struct statx stx;
- if (syscall(SYS_statx, 0, disk->mountpoint.chars, 0, STATX_BTIME, &stx) == 0 && (stx.stx_mask & STATX_BTIME) && stx.stx_btime.tv_sec > 685065600 /*birth of Linux*/)
+ if (statx(0, disk->mountpoint.chars, 0, STATX_BTIME, &stx) == 0 && (stx.stx_mask & STATX_BTIME))
disk->createTime = (uint64_t)((stx.stx_btime.tv_sec * 1000) + (stx.stx_btime.tv_nsec / 1000000));
#endif
Expected behavior example:
~ $ fastfetch
-o o- u0_a289@localhost
+hydNNNNdyh+ -----------------
+mMMMMMMMMMMMMm+ OS: Android REL 10 aarch64
`dMMm:NMMMMMMN:mMMd` Host: samsung SM-G960U
hMMMMMMMMMMMMMMMMMMh Kernel: Linux 4.9.186-22990479
.. yyyyyyyyyyyyyyyyyyyy .. Uptime: 2 days, 22 hours, 13 mins
.mMMm`MMMMMMMMMMMMMMMMMMMM`mMMm. Packages: 752 (dpkg)
:MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM: Shell: bash 5.3.3
:MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM: WM: WindowManager (SurfaceFlinger)
:MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM: Terminal: /dev/pts/2
:MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM: CPU: 2 x Qualcomm Technologies, Inc SDM845 (8) @ 2.80 GHz
-MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM- GPU: Qualcomm Turnip Adreno (TM) 630 [Integrated]
+yy+ MMMMMMMMMMMMMMMMMMMM +yy+ Memory: 2.60 GiB / 3.50 GiB (74%)
mMMMMMMMMMMMMMMMMMMm Swap: 1.78 GiB / 2.50 GiB (71%)
`/++MMMMh++hMMMM++/` Disk (/): 4.51 GiB / 4.57 GiB (99%) - ext4 [Read-only]
MMMMo oMMMM Local IP (wlan0): 192.168.12.191/24
MMMMo oMMMM Battery: 100% [USB Connected]
oNMm- -mMNs Locale: en_US.UTF-8
~ $
Related reading about a slightly similar problem that happened before in another software, OpenJDK!
Related Android NDK header information:
Version used
fastfetch 2.53.0 (aarch64)
Bug prevalence
Always
Regression
Yes
Installation
Package manager
Package manager
apt (Termux)
Screenshots

Configuration
Stacktrace
~ $ gdb -q -ex 'set confirm off' -ex run -ex 'bt full' -ex quit --args $PREFIX/bin/fastfetch
Reading symbols from /data/data/com.termux/files/usr/bin/fastfetch...
Starting program: /data/data/com.termux/files/usr/bin/fastfetch
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/data/data/com.termux/files/usr/lib/libthread_db.so".
-o o- u0_a289@localhost
+hydNNNNdyh+ -----------------
+mMMMMMMMMMMMMm+ OS: Android REL 10 aarch64
`dMMm:NMMMMMMN:mMMd` Host: samsung SM-G960U
hMMMMMMMMMMMMMMMMMMh Kernel: Linux 4.9.186-22990479
.. yyyyyyyyyyyyyyyyyyyy .. Uptime: 2 days, 22 hours, 6 mins
.mMMm`MMMMMMMMMMMMMMMMMMMM`mMMm. Packages: 752 (dpkg)
:MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM: Shell: bash 5.3.3
[Detaching after fork from child process 23922]
:MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM: WM: WindowManager (SurfaceFlinger)
:MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM: Terminal: /dev/pts/2
-MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM- CPU: 2 x Qualcomm Technologies, Inc SDM845 (8) @ 2.80 GHz
[New Thread 0x5d74 (LWP 23924)]
[Thread 0x5d74 (LWP 23924) exited]
warning: Temporarily disabling breakpoints for unloaded shared library "/data/data/com.termux/files/usr/lib/libLLVM.so"
MMMMo oMMMM GPU: Qualcomm Turnip Adreno (TM) 630 [Integrated]
MMMMo oMMMM Memory: 2.66 GiB / 3.50 GiB (76%)
oNMm- -mMNs Swap: 1.72 GiB / 2.50 GiB (69%)
Thread 1 "fastfetch" received signal SIGSYS, Bad system call.
0x0000007fb6952340 in syscall () from /apex/com.android.runtime/lib64/bionic/libc.so
#0 0x0000007fb6952340 in syscall () from /apex/com.android.runtime/lib64/bionic/libc.so
No symbol table info available.
#1 0x00000055556910d8 in detectStats (disk=0x7fb6225000) at /home/builder/.termux-build/fastfetch/src/src/detection/disk/disk_linux.c:272
fs = {f_bsize = 4096, f_frsize = 4096, f_blocks = 1199298, f_bfree = 17509, f_bavail = 17509, f_files = 304608, f_ffree = 297895, f_favail = 297895,
f_fsid = 18446744072244205055, f_flag = 4101, f_namemax = 255, __f_reserved = {1433395104, 85, 3066138656, 127, 1919458168, 4163905019}}
stx = {stx_mask = 3055561473, stx_blksize = 0, stx_attributes = 4294967297, stx_nlink = 3063696600, stx_uid = 127, stx_gid = 1919458168,
stx_mode = 9723, __spare0 = {63536}, stx_ino = 18446744073709551606, stx_size = 10, stx_blocks = 17883835882174716792, stx_attributes_mask = 8,
stx_atime = {tv_sec = -562908191534834824, tv_nsec = 0, __reserved = 0}, stx_btime = {tv_sec = 366504192805, tv_nsec = 1432236041, __reserved = 85},
stx_ctime = {tv_sec = 366505615264, tv_nsec = 7, __reserved = 0}, stx_mtime = {tv_sec = 1, tv_nsec = 1431843095, __reserved = 85},
stx_rdev_major = 3066138656, stx_rdev_minor = 127, stx_dev_major = 13, stx_dev_minor = 0, stx_mnt_id = 366504272233, stx_dio_mem_align = 3066138656,
stx_dio_offset_align = 127, stx_subvol = 549755806336, stx_atomic_write_unit_min = 3063627064, stx_atomic_write_unit_max = 127,
stx_atomic_write_segments_max = 4294960176, __spare1 = {127}, __spare3 = {549755806656, 549755806608, 18446743528248704984, 17883835882174716792,
548516521132, 1431972638, 18446744069414584840, 548516521119, 13}}
#2 ffDetectDisksImpl (options=0x7fffffe7a8, disks=<optimized out>, disks@entry=0x7fffffe2c0)
at /home/builder/.termux-build/fastfetch/src/src/detection/disk/disk_linux.c:321
disk = 0x7fb6225000
mountsFile = 0x7fb625c018
device = <optimized out>
#3 0x000000555560d3c0 in ffDetectDisks (options=0x7fffffe7a8, disks=disks@entry=0x7fffffe2c0)
at /home/builder/.termux-build/fastfetch/src/src/detection/disk/disk.c:10
error = <optimized out>
#4 0x000000555562d584 in ffPrintDisk (options=0x7fffffe7a8) at /home/builder/.termux-build/fastfetch/src/src/modules/disk/disk.c:192
disks = {data = 0x7fb6225000 " ", elementSize = 120, length = 1, capacity = 16}
error = <optimized out>
index = <optimized out>
#5 0x0000005555601e88 in parseStructureCommand (line=0x7fb621f28d "Disk", fn=fn@entry=0x5555601ef8 <genJsonResult>, jsonDoc=jsonDoc@entry=0x0)
at /home/builder/.termux-build/fastfetch/src/src/common/commandoption.c:162
optionBuf = "\000\000\000\000\000\000\000\000\323hYUU", '\000' <repeats 11 times>, "\323hYUU\000\000\000\000\000\000\000\003\000\000\000/\360[UU", '\00.
baseInfo = 0x55556fb888 <ffDiskModuleInfo>
modules = <optimized out>
#6 0x0000005555601bf0 in ffPrintCommandOption (data=data@entry=0x7fffffe9d0, jsonDoc=0x0)
at /home/builder/.termux-build/fastfetch/src/src/common/commandoption.c:186
ms = 0
colonIndex = 145
startIndex = 141
thres = -1
#7 0x00000055556d5e44 in run (data=0x7fffffe9d0) at /home/builder/.termux-build/fastfetch/src/src/fastfetch.c:768
useJsonConfig = false
#8 main (argc=1, argv=<optimized out>) at /home/builder/.termux-build/fastfetch/src/src/fastfetch.c:837
data = {structure = {allocated = 256, length = 194, chars = 0x7fb621f200 "Title"}, configLoaded = false}
~ $
strace log (does not fit in GitHub): https://termbin.com/an8r