cions
cions
I realized that the real culpit is seccomp. ``` $ grep Seccomp: /proc/self/status Seccomp: 2 $ strace -fqq --signal=SIGSYS --trace=none go env [pid 12717] --- SIGSYS {si_signo=SIGSYS, si_code=SYS_SECCOMP, si_call_addr=0x5a46509700, si_syscall=__NR_pidfd_open,...
Alternatively, check kernel version? https://github.com/golang/go/blob/master/src/internal/syscall/unix/kernel_version_linux.go
Not to check the seccomp policy, but to check if the kernel version supports pidfd. Since Android with newer kernel would not have the problem, I don't think disabling pidfd...
https://github.com/termux/termux-packages/issues/21265 Users reported go works fine on newer Android
https://android-review.googlesource.com/c/platform/bionic/+/1208625 https://cs.android.com/android/_/android/platform/bionic/+/refs/tags/android-11.0.0_r1:libc/SECCOMP_WHITELIST_COMMON.TXT;l=76 pidfd_open was added to seccomp allow list since Android 11 And https://source.android.com/docs/core/architecture/kernel/generic-kernel-image#inhibits-platform-upgrades > Android 10 supports 3.18, 4.4, 4.9, 4.14, and 4.19 kernels So, checking if the kernel...
Oops, pidfd_send_signal was not allowed in Android 11, but it fixed in 12 Since Android 11 supports only 4.19 and 5.4 kernels (https://source.android.com/docs/core/architecture/kernel/android-common), change to check against 5.5 rather than...
You're right, we should check Android version >= 12 rather than kernel version. Here is the way to get Android version in C (sorry I'm not familiar with Cgo) https://gist.github.com/cions/07fa5f11e38945fa96916888b7e88d0c