Skip to content

Bug: TUI hangs silently when /tmp is mounted noexec (dlopen of libopentui.so fails) #26136

Closed as not planned

Description

@LeaCoder0

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

  1. 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)
  2. confirm with findmnt /tmp -no OPTIONS (should contain noexec)
  3. run opencode
  4. hangs with no prompt

Operating System

Ubuntu 24.04 LTS, kernel 6.17

Terminal

GNOME Terminal (also reproduces in tmux, alacritty, plain TTY)

Activity

  1. kommander commented on May 11, 2026

    @kommander
    Contributor

    Setting BUN_TMPDIR to an executable dir is currently the only way I am afraid. That is a bun issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions