You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
opencode1 1.18.34 crashes on Android 12: seccomp kills close_range with SIGSYS #36
opencode1 1.18.34 from release Push261005 cannot start in Termux on this Android 12 device. Even opencode1 --version is terminated with SIGSYS because the process invokes the close_range syscall and Android's seccomp policy blocks it.
This appears related to the older native-build startup crash reported in #17, but this report includes a trace identifying the exact blocked syscall on a newer release and a different Android/kernel environment.
Environment
Termux app: 0.119.0-beta.3 (GitHub build)
Android: 12, API level 31
ABI: arm64-v8a (AArch64)
Kernel: 4.14.190-perf-ga0a12da82658
Package: opencode1 1.18.34
Release: Push261005
Steps to reproduce
Install opencode1 1.18.34 in Termux.
Run:
opencode1 --version
Expected behavior
The command prints the version and exits successfully.
Actual behavior
The process exits with status 159 (SIGSYS) and the shell reports:
Bad system call
A trace of the process shows the seccomp-generated signal and identifies the blocked syscall:
The binary (or a bundled runtime/library) invokes close_range, which is blocked by the Android app seccomp policy on this device. Please identify which component issues the syscall and provide a compatible fallback. Possible approaches include avoiding close_range on Android or falling back to closing file descriptors individually when the syscall is unavailable or denied, where the runtime permits that behavior.
If the syscall is emitted by the bundled runtime/toolchain and cannot be handled by application-level fallback, please consider an Android-compatible build/runtime or a targeted compatibility patch. Testing on Android 12 with a 4.14 kernel would verify the fix.
Related report
This may be related to the native build startup failure described in #17. The current report narrows the failure down to close_range on opencode1 1.18.34.
Fixed in Push261016 — thank you for the precise strace, it made this a quick root-cause.
Root cause: the libopencode-crhandler.so seccomp shim (which interposes close_range() with -ENOSYS, exactly the fallback you suggested) was shipped inside the packages but was never actually linked in — the binary's DT_NEEDED list didn't reference it, so the dynamic linker never loaded it and the raw close_range syscall went straight to the seccomp filter. Three wiring bugs caused this (the v1 family-native chain never invoked the hardening step; the v2 direct-build path bypassed it; the compression tool compressed un-hardened binaries). Our local smoke tests all passed because this device's seccomp policy doesn't block close_range — exactly the environment-dependent blind spot you flagged.
Fix: all three paths now run the zero-displacement DT_NEEDED patch (shim first in the lookup chain) before packaging/compression, and the compression tool refuses un-hardened binaries. Affected packages were repacked and re-uploaded:
Verify after install: readelf -dW /data/data/com.termux/files/usr/lib/opencode1/runtime/opencode | grep crhandler should list libopencode-crhandler.so (for compressed packages, uncompress first with upx -d). The same batch also ships v2 2.0.28–2.0.31 and v1 1.19.1–1.19.3 if you want to move up.
We don't have an Android 12 device in our test matrix, so if you can re-test opencode1 --version on the Push261016 build of your version, that would close the loop — and if anything still trips, the full strace again would be gold.
Thanks for the quick turnaround and the detailed root-cause writeup — much appreciated. I re-tested the Push261016 build: opencode1 --version and the TUI startup both work fine on my Android 12 device now. Confirming the close_range/SIGSYS issue is resolved on my end. Thanks again for shipping the fix.
Closing — you confirmed the Push261016 build works on your Android 12 device, which closes the loop. Thanks for the precise strace (it made the root cause a same-day fix) and for coming back to re-test.
Activity
Hope2333 commentedon Oct 17, 2026
Fixed in Push261016 — thank you for the precise strace, it made this a quick root-cause.
Root cause: the
libopencode-crhandler.soseccomp shim (which interposesclose_range()with-ENOSYS, exactly the fallback you suggested) was shipped inside the packages but was never actually linked in — the binary'sDT_NEEDEDlist didn't reference it, so the dynamic linker never loaded it and the rawclose_rangesyscall went straight to the seccomp filter. Three wiring bugs caused this (the v1family-nativechain never invoked the hardening step; the v2 direct-build path bypassed it; the compression tool compressed un-hardened binaries). Our local smoke tests all passed because this device's seccomp policy doesn't blockclose_range— exactly the environment-dependent blind spot you flagged.Fix: all three paths now run the zero-displacement
DT_NEEDEDpatch (shim first in the lookup chain) before packaging/compression, and the compression tool refuses un-hardened binaries. Affected packages were repacked and re-uploaded:opencode1native 1.18.30–1.18.34 (Push261005), 1.18.35 / 1.19.0 (Push261013)opencodenative 2.0.23–2.0.27 (Push261013)*-compressedpackagesVerify after install:
readelf -dW /data/data/com.termux/files/usr/lib/opencode1/runtime/opencode | grep crhandlershould listlibopencode-crhandler.so(for compressed packages, uncompress first withupx -d). The same batch also ships v2 2.0.28–2.0.31 and v1 1.19.1–1.19.3 if you want to move up.We don't have an Android 12 device in our test matrix, so if you can re-test
opencode1 --versionon the Push261016 build of your version, that would close the loop — and if anything still trips, the full strace again would be gold.DARKBOYJYOTI commentedon Oct 18, 2026
Thanks for the quick turnaround and the detailed root-cause writeup — much appreciated. I re-tested the Push261016 build:
opencode1 --versionand the TUI startup both work fine on my Android 12 device now. Confirming the close_range/SIGSYS issue is resolved on my end. Thanks again for shipping the fix.Hope2333 commentedon Oct 23, 2026
Closing — you confirmed the Push261016 build works on your Android 12 device, which closes the loop. Thanks for the precise strace (it made the root cause a same-day fix) and for coming back to re-test.
fix(seccomp): harden 接线修复(issue Hope2333#36 Android12 close_range SIG…
fix(packaging): 未 harden 件禁止上架 + require_clang 前置门(Hope2333#36 闭环加固)