Segfaults on musl box #2568

Open
opened 2026-02-16 17:36:16 -05:00 by yindo · 2 comments
Owner

Originally created by @Vaelatern on GitHub (Nov 4, 2025).

Originally assigned to: @kommander on GitHub.

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

Originally created by @Vaelatern on GitHub (Nov 4, 2025). Originally assigned to: @kommander on GitHub. ### 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_
yindo added the opentuibug labels 2026-02-16 17:36:16 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 4, 2025):

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

  • #649: Same problem with Alpine Linux (musl-based distros) - binary fails to run due to glibc vs musl incompatibility
  • #462: Request for static linked binaries to solve similar dynamic linking issues on NixOS
  • #3540: Similar dynamic linking problems on NixOS - same class of system compatibility issue

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.

@github-actions[bot] commented on GitHub (Nov 4, 2025): This issue might be a duplicate of existing issues. Please check: - #649: Same problem with Alpine Linux (musl-based distros) - binary fails to run due to glibc vs musl incompatibility - #462: Request for static linked binaries to solve similar dynamic linking issues on NixOS - #3540: Similar dynamic linking problems on NixOS - same class of system compatibility issue 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.
Author
Owner

@kommander commented on GitHub (Nov 4, 2025):

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

@kommander commented on GitHub (Nov 4, 2025): That is an opentui lib issue actually, possibly because it is cross compiled. Need to pick that up in the opentui repo.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2568