previous version of mpv worked fine
the new version plays audio without a problem
however, gives a segmentation fault with --list-options
this breaks another app I have which relies on the --list-options to finish with exit code 0
anyone else get the segmentation fault with mpv --list-options
running latest version of termux on a kindle fire 7 tablet (2015 model, armv7)
Cannot reproduce here with an arm prefix on aarch64 device:
$ file ../usr/libexec/mpv
../usr/libexec/mpv: ELF 32-bit LSB pie executable ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /system/bin/linker, stripped
$ mpv --list-options | tail
--watch-later-directory String (default: ) [file]
--wid Integer64 (default: -1)
--window-dragging Flag (default: yes)
--window-scale Double (0.001 to 100) (default: 1.000000)
--write-filename-in-watch-later-config Flag (default: no)
--x11-name String (default: )
--{ Flag [not in config files] [no runtime changes]
--} Flag [not in config files] [no runtime changes]
Total: 676 options
$
Can you find any backtrace or so in logcat?
藡mpv --list-options藡 work fine on my arm device, no segfault happens.
here is the stack trace
$> strace mpv --list-options
execve("/data/data/com.termux/files/usr/bin/mpv", ["mpv", "--list-options"], 0xbefc2c6c /* 17 vars */) = 0
mprotect(0xb6f69000, 4096, PROT_READ) = 0
set_tid_address(0xb6f6abf4) = 9602
set_tls(0xb6f6ae30) = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f58000
madvise(0xb6f58000, 8192, MADV_MERGEABLE) = 0
sigaltstack({ss_sp=0xb6f58000, ss_flags=0, ss_size=8192}, NULL) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f57000
madvise(0xb6f57000, 4096, MADV_MERGEABLE) = 0
mprotect(0xb6f57000, 4096, PROT_READ) = 0
mprotect(0xb6f57000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xb6f57000, 4096, PROT_READ) = 0
mprotect(0xb6f57000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xb6f57000, 4096, PROT_READ) = 0
sigaction(SIGABRT, {sa_handler=0xb6f5bb0d, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0xb6f629a8}, NULL) = 0
sigaction(SIGBUS, {sa_handler=2xb6f5bb0d, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0xb6f629a8}, NULL) = 0
sigaction(SIGFPE, {sa_handler=0xb6f5bb0d, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0xb6f629a8}, NULL) = 0
sigaction(SIGILL, {sa_handler=0xb6f5bb0d, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0xb6f629a8}, NULL) = 0
sigaction(SIGPIPE, {sa_handler=0xb6f5bb0d, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0xb6f629a8}, NULL) = 0
sigaction(SIGSEGV, {sa_handler=0xb6f5bb0d, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0xb6f629a8}, NULL) = 0
sigaction(SIGSTKFLT, {sa_handler=0xb6f5bb0d, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0xb6f629a8}, NULL) = 0
sigaction(SIGTRAP, {sa_handler=0xb6f5bb0d, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0xb6f629a8}, NULL) = 0
personality(0xffffffff) = 0x800000 (PER_LINUX|ADDR_LIMIT_32BIT)
personality(PER_LINUX32|ADDR_LIMIT_32BIT) = 0x800000 (PER_LINUX|ADDR_LIMIT_32BIT)
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0) = 0xb6f56000
madvise(0xb6f56000, 4096, MADV_MERGEABLE) = 0
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, 0xb6f56000, 4096, "linker_alloc") = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0) = 0xb6f55000
madvise(0xb6f55000, 4096, MADV_MERGEABLE) = 0
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, 0xb6f55000, 4096, "linker_alloc") = 0
openat(AT_FDCWD, "/data/data/com.termux/files/usr/lib/libtermux-exec.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0700, st_size=5332, ...}) = 0
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6f54000
madvise(0xb6f54000, 4096, MADV_MERGEABLE) = 0
mmap2(NULL, 12288, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f51000
madvise(0xb6f51000, 12288, MADV_MERGEABLE) = 0
mmap2(0xb6f51000, 1709, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb6f51000
madvise(0xb6f51000, 1709, MADV_MERGEABLE) = 0
mmap2(0xb6f52000, 4168, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb6f52000
madvise(0xb6f52000, 4168, MADV_MERGEABLE) = 0
munmap(0xb6f54000, 4096) = 0
close(3) = 0
openat(AT_FDCWD, "/data/data/com.termux/files/usr/lib/libc.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/vendor/lib/libc.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/system/lib/libc.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=510911, ...}) = 0
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6f54000
madvise(0xb6f54000, 4096, MADV_MERGEABLE) = 0
mmap2(NULL, 413696, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6eec000
madvise(0xb6eec000, 413696, MADV_MERGEABLE) = 0
mmap2(0xb6eec000, 348460, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb6eec000
madvise(0xb6eec000, 348460, MADV_MERGEABLE) = 0
mmap2(0xb6f42000, 21780, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x55000) = 0xb6f42000
madvise(0xb6f42000, 21780, MADV_MERGEABLE) = 0
mmap2(0xb6f48000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6f48000
madvise(0xb6f48000, 36864, MADV_MERGEABLE) = 0
munmap(0xb6f54000, 4096) = 0
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0) = 0xb6f54000
madvise(0xb6f54000, 4096, MADV_MERGEABLE) = 0
prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, 0xb6f54000, 4096, "linker_alloc") = 0
mprotect(0xb6f42000, 12288, PROT_READ) = 0
mprotect(0xb6f52000, 4096, PROT_READ) = 0
mprotect(0xb6f7e000, 4096, PROT_READ) = 0
openat(AT_FDCWD, "/dev/__properties__", O_RDONLY|O_LARGEFILE|O_NOFOLLOW|O_CLOEXEC) = 3
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0
fstat64(3, {st_mode=S_IFREG|0444, st_size=131072, ...}) = 0
mmap2(NULL, 131072, PROT_READ, MAP_SHARED, 3, 0) = 0xb6ecc000
close(3) = 0
futex(0xb6f4758c, FUTEX_WAKE_PRIVATE, 2147483647) = 0
mprotect(0xb6f56000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xb6f54000, 4096, PROT_READ|PROT_WRITE) = 0
openat(AT_FDCWD, "/data/data/com.termux/files/usr/lib/libnetd_client.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/vendor/lib/libnetd_client.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/system/lib/libnetd_client.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=9352, ...}) = 0
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6ecb000
madvise(0xb6ecb000, 4096, MADV_MERGEABLE) = 0
mmap2(NULL, 16384, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6ec7000
madvise(0xb6ec7000, 16384, MADV_MERGEABLE) = 0
mmap2(0xb6ec7000, 3856, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb6ec7000
madvise(0xb6ec7000, 3856, MADV_MERGEABLE) = 0
mmap2(0xb6ec9000, 4100, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1000) = 0xb6ec9000
madvise(0xb6ec9000, 4100, MADV_MERGEABLE) = 0
munmap(0xb6ecb000, 4096) = 0
close(3) = 0
openat(AT_FDCWD, "/data/data/com.termux/files/usr/lib/libm.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/vendor/lib/libm.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/system/lib/libm.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=95444, ...}) = 0
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6ecb000
madvise(0xb6ecb000, 4096, MADV_MERGEABLE) = 0
mmap2(NULL, 102400, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6eae000
madvise(0xb6eae000, 102400, MADV_MERGEABLE) = 0
mmap2(0xb6eae000, 90052, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb6eae000
madvise(0xb6eae000, 90052, MADV_MERGEABLE) = 0
mmap2(0xb6ec5000, 4204, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x16000) = 0xb6ec5000
madvise(0xb6ec5000, 4204, MADV_MERGEABLE) = 0
munmap(0xb6ecb000, 4096) = 0
close(3) = 0
openat(AT_FDCWD, "/data/data/com.termux/files/usr/lib/libstdc++.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/vendor/lib/libstdc++.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/system/lib/libstdc++.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=9324, ...}) = 0
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb6ecb000
madvise(0xb6ecb000, 4096, MADV_MERGEABLE) = 0
mmap2(NULL, 16384, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6eaa000
madvise(0xb6eaa000, 16384, MADV_MERGEABLE) = 0
mmap2(0xb6eaa000, 5782, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb6eaa000
madvise(0xb6eaa000, 5782, MADV_MERGEABLE) = 0
mmap2(0xb6eac000, 4100, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1000) = 0xb6eac000
madvise(0xb6eac000, 4100, MADV_MERGEABLE) = 0
munmap(0xb6ecb000, 4096) = 0
close(3) = 0
mprotect(0xb6eac000, 4096, PROT_READ) = 0
mprotect(0xb6ec5000, 4096, PROT_READ) = 0
mprotect(0xb6ec9000, 4096, PROT_READ) = 0
mprotect(0xb6f56000, 4096, PROT_READ) = 0
mprotect(0xb6f54000, 4096, PROT_READ) = 0
futex(0xb6f48db8, FUTEX_WAKE_PRIVATE, 2147483647) = 0
mprotect(0xb6f56000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xb6f54000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xb6f56000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xb6f54000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xb6f56000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xb6f54000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xb6f56000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xb6f54000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xb6f56000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xb6f54000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xb6f56000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xb6f54000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xb6f56000, 4096, PROT_READ) = 0
mprotect(0xb6f54000, 4096, PROT_READ) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6ecb000
madvise(0xb6ecb000, 4096, MADV_MERGEABLE) = 0
mprotect(0xb6ecb000, 4096, PROT_READ) = 0
rt_sigprocmask(SIG_BLOCK, [], [], 8) = 0
sigaction(SIGCHLD, {sa_handler=0xb6f78881, sa_mask=~[], sa_flags=SA_RESTORER, sa_restorer=0xb6efe954}, NULL) = 0
geteuid32() = 10031
gettimeofday({tv_sec=1531219451, tv_usec=385541}, NULL) = 0
brk(NULL) = 0xb79e2000
brk(0xb79e3000) = 0xb79e3000
getppid() = 9600
fstatat64(AT_FDCWD, "/data/data/com.termux/files/home", {st_mode=S_IFDIR|0700, st_size=4096, ...}, 0) = 0
fstatat64(AT_FDCWD, ".", {st_mode=S_IFDIR|0700, st_size=4096, ...}, 0) = 0
openat(AT_FDCWD, "/data/data/com.termux/files/usr/bin/mpv", O_RDONLY|O_LARGEFILE) = 3
fcntl64(3, F_DUPFD, 10) = 10
close(3) = 0
fcntl64(10, F_SETFD, FD_CLOEXEC) = 0
sigaction(SIGINT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}) = 0
sigaction(SIGINT, {sa_handler=0xb6f78881, sa_mask=~[], sa_flags=SA_RESTORER, sa_restorer=0xb6efe954}, NULL) = 0
sigaction(SIGQUIT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}) = 0
sigaction(SIGQUIT, {sa_handler=SIG_DFL, sa_mask=~[], sa_flags=SA_RESTORER, sa_restorer=0xb6efe954}, NULL) = 0
sigaction(SIGTERM, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}) = 0
sigaction(SIGTERM, {sa_handler=SIG_DFL, sa_mask=~[], sa_flags=SA_RESTORER, sa_restorer=0xb6efe954}, NULL) = 0
read(10, "#!/data/data/com.termux/files/us"..., 1024) = 546
rt_sigprocmask(SIG_BLOCK, [], [], 8) = 0
rt_sigprocmask(SIG_BLOCK, [], [], 8) = 0
rt_sigprocmask(SIG_BLOCK, [], [], 8) = 0
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb6f6abf4) = 9603
wait4(-1, 0xbea419a8, 0, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_STOPPED, si_pid=9603, si_uid=10031, si_status=SIGSTOP, si_utime=46, si_stime=10} ---
sigreturn({mask=[]}) = -1 EINTR (Interrupted system call)
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_CONTINUED, si_pid=9603, si_uid=10031, si_status=SIGCONT, si_utime=46, si_stime=10} ---
sigreturn({mask=[]}) = -1 EINTR (Interrupted system call)
wait4(-1, [{WIFSIGNALED(s) && WTERMSIG(s) == SIGSEGV}], 0, NULL) = 9603
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=9603, si_uid=10031, si_status=SIGSEGV, si_utime=46, si_stime=10} ---
sigreturn({mask=[]}) = 9603
write(2, "Segmentation fault\n", 19) = 19
read(10, "", 1024) = 0
rt_sigprocmask(SIG_BLOCK, [], [], 8) = 0
rt_sigprocmask(SIG_BLOCK, [], [], 8) = 0
exit_group(139) = ?
+++ exited with 139 +++
It's back trace in logcat that I've asked for...
ok, here is the logcat:
F/libc (22361): Fatal signal 11 (SIGSEGV), code1, fault addr 0xbec35000 in tid 22361 (mpv)
In the meantime, can the previous version be added back into the termux repo, so I can install that target? (it also will require a rolled back version of ffmpeg maybe?)
Can you compile and run the following program and report back the output:
#include <stdio.h>
int main() {
printf("%zu\n", SIZE_MAX);
printf("%zu\n", strnlen("test", SIZE_MAX));
}
(Just save it as e.g. test.c and run clang test.c; ./a.out)
I don't feel like it has something to do with the version bump. It's either the strnlen in your Android build is broken, or the recent upgrade of NDK.
It's pretty easy to build your own mpv on Termux btw. Just remember to run waf and the built mpv with LD_LIBRARY_PATH=/system/lib:$PREFIX/lib. Both 0.27 and 0.28 can be built with ffmpeg 4.
@dskrad you can install older versions from @xeffyr repo: https://wiki.termux.com/wiki/Package_Management#Termux_Mirror
@tomty89 here are the results:
WARNING: linker: ./a.out: unused DT entry: type 0x6ffffef5 arg 0x23c
4294967295
4294967295
@Grimler91 thanks for the tip. I installed mpv=0.27.2 which works for my purposes now.
I suppose your system is Android L (5.0) based, where strnlen is still broken (otherwise the second line of output would be 4).
I opened a PR to enable back the strnlen subsitition, though I am not sure if it's necessary as we are probably going to drop Android L support soon anyway.
@dskrad Actually, can you confirm --list-options does not trigger a segfault with https://termux.xeffyr.ml/dists/stable/main/binary-arm/mpv_0.28.2_arm.deb? As the strnlen subsitition is only disabled since 0.28.2-1.
This should now be fixed in version 0.28.2-2 of the mpv package, which is available for installation!
@tomty89 0.27.2. Gave an error about being compiled with a different ffmpeg version. I upgraded to 0.28.2-2 which fixes the seg fault.
I am running Termux on a Kindle Fire running Fire OS 5.6.1.0 (Android L fork). I also have Termux on my Android N phone, but I mostly use it on my Kindle Fire tablet. Please consider keeping support for these devices.
@fornwall Thanks. Glad this could be fixed for Android L based devices.
Most helpful comment
@dskrad you can install older versions from @xeffyr repo: https://wiki.termux.com/wiki/Package_Management#Termux_Mirror