Open knyipab opened 2 months ago
I can reproduce the issue in my Android device (Linux 4.19.312 Android 14). Here is the strace output.
SIGSYS {si_signo=SIGSYS, si_code=SYS_SECCOMP, si_call_addr=0x7397c5a9d0, si_syscall=__NR_semget, si_arch=AUDIT_ARCH_AARCH64}
This library doesn't actually implements system call replacement stubs.
int semget(key_t key, int n, int flags) {
#if defined(SYS_semget)
return syscall(SYS_semget, key, n, flags);
#else
return syscall(SYS_ipc, SEMGET, key, n, flags, 0, 0);
#endif
}
If semget
isn't allowed by seccomp on Android 14, then crash could be expected with current implementation.
semget
-related syscalls are disabled since Android 8.0. A related issue has been reported in #17780.
I could implement them using libandroid-shmem
if I have more free time, but I'm currently doing an internship...
For jack2
, I ended up using posix semaphore and submitted a PR in https://github.com/termux/termux-packages/pull/20544.
For qt6-qtbase
, it specifies libandroid-sysv-semaphore
as deps. But I tested both QSemaphore
and QSystemSemaphore
and they all work fine. I doubt if sysv semaphore is indeed used as the backend for qt6.
It is still good to have a fix, perhaps for the sake of other depending packages or for termux users who compiled depending programs themselves. Appreciated and no pressure.
Problem description
I am building a package (
jack2
) that uses SYSV semaphore (libandroid-sysv-semaphore
). However, it prompts bad system call in runtime. I can reproduce the issue with a simple test example below. Not sure if this is dependent on Android version, Linux kernel, or vendor.What steps will reproduce the bug?
Here is an example taken from
qt6-qtbase
configure file: https://github.com/qt/qtbase/blob/79e00b0b25765b85b112b601fee70184b1efe3c0/src/corelib/configure.cmake#L258-L272.sysv_sem.cpp
commands to run
And it prints
bad system call
.Output from
gdb
What is the expected behavior?
No response
System information