Description
/tmp on my machine is mounted with noexec (Ubuntu corporate hardening — CIS-style fstab line with nosuid,nodev,noexec). When I run opencode, the TUI hangs forever. Nothing visible. With --print-logs --log-level DEBUG the cause shows up:
ERROR ... service=default e=Failed to initialize OpenTUI render library: Failed to open library "/tmp/.f9ef37f75ffbafff-00000001.so": /tmp/.f9ef37f75ffbafff-00000001.so: failed to map segment from shared object rejection
Bun unpacks libopentui.so into $TMPDIR (defaults to /tmp) and then dlopens it. With noexec, mmap can't grant exec perms on the segments, so dlopen fails. The TUI catches the error but never produces user-visible output, hence the silent hang.
opencode run "..." works because it doesn't load the TUI shared library.
#5175 covered the same problem and was auto-closed after 90 days of inactivity; maintainer comment there says to open a new issue if still relevant. Same root cause as #3765, #4605, #6080.
Workaround that works today:
BUN_TMPDIR=$HOME/.cache/opencode-tmp opencode
Plugins
none
OpenCode version
1.14.40
Steps to reproduce
- add
tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0 to /etc/fstab and reboot (or any Lynis/CIS hardening that does this)
- confirm with
findmnt /tmp -no OPTIONS (should contain noexec)
- run
opencode
- hangs with no prompt
Operating System
Ubuntu 24.04 LTS, kernel 6.17
Terminal
GNOME Terminal (also reproduces in tmux, alacritty, plain TTY)
Description
/tmpon my machine is mounted withnoexec(Ubuntu corporate hardening — CIS-style fstab line withnosuid,nodev,noexec). When I runopencode, the TUI hangs forever. Nothing visible. With--print-logs --log-level DEBUGthe cause shows up:Bun unpacks
libopentui.sointo$TMPDIR(defaults to/tmp) and thendlopens it. Withnoexec, mmap can't grant exec perms on the segments, so dlopen fails. The TUI catches the error but never produces user-visible output, hence the silent hang.opencode run "..."works because it doesn't load the TUI shared library.#5175covered the same problem and was auto-closed after 90 days of inactivity; maintainer comment there says to open a new issue if still relevant. Same root cause as#3765,#4605,#6080.Workaround that works today:
Plugins
none
OpenCode version
1.14.40
Steps to reproduce
tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0to/etc/fstaband reboot (or any Lynis/CIS hardening that does this)findmnt /tmp -no OPTIONS(should containnoexec)opencodeOperating System
Ubuntu 24.04 LTS, kernel 6.17
Terminal
GNOME Terminal (also reproduces in tmux, alacritty, plain TTY)