Skip to content

Segfaults on musl box #3876

Closed
Closed

Description

@Vaelatern

Description

The shipped binary links against glibc. It segfaults when the compat layer is present. It simply fails to run otherwise.

[user@node5 ~]$ /home/user/node_modules/opencode-linux-x64/bin/opencode
-bash: /home/user/node_modules/opencode-linux-x64/bin/opencode: cannot execute: required file not found
[user@node5 ~]$ file /home/user/node_modules/opencode-linux-x64/bin/opencode
/home/user/node_modules/opencode-linux-x64/bin/opencode: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=668a1c029f30aa64ce77170cdab8fc16233395b1, not stripped
[user@node5 ~]$ /lib64/ld-linux-x86-64.so.2
-bash: /lib64/ld-linux-x86-64.so.2: No such file or directory

On a different system, running in valgrind results in:

==6016== Syscall param execve(argv) points to uninitialised byte(s)
==6016==    at 0x6775B2B: ??? (in /usr/lib/ld-linux-x86-64.so.2)
==6016==    by 0x1FFEFFFC77: ???
==6016==    by 0x67751F1: ??? (in /usr/lib/ld-linux-x86-64.so.2)
==6016==    by 0x677584A: ??? (in /usr/lib/ld-linux-x86-64.so.2)
==6016==  Address 0x677b038 is in the brk data segment 0x677b000-0x677bfff

Among ways to fix this:

  1. Static compilation of the binary. Zig should make this easy.
  2. Build the binary for more libcs.

OpenCode version

1.0.20

Steps to reproduce

  1. Install Void Linux musl (all works fine on glibc)
  2. npm install opencode-ai@latest
  3. node_modules/.bin/opencode

Screenshot and/or share link

No response

Operating System

Void Linux x86_64 musl

Terminal

No response

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 4, 2025
  2. github-actions commented on Nov 4, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    All of these issues stem from the same root cause: OpenCode's binary is dynamically linked against glibc and cannot run on musl-based systems or systems with different library setups. The proposed solutions (static compilation or building for multiple libcs) are also consistent across these issues.

    Feel free to ignore if none of these address your specific case.

  3. self-assigned this
    on Nov 4, 2025
  4. kommander commented on Nov 4, 2025

    @kommander
    Contributor

    That is an opentui lib issue actually, possibly because it is cross compiled. Need to pick that up in the opentui repo.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions