Skip to content

fix: add GLIBC version detection to prevent cryptic errors on older Linux - #276

Open
algojogacor wants to merge 1 commit into
smol-machines:mainfrom
algojogacor:fix/glibc-compat-detection
Open

fix: add GLIBC version detection to prevent cryptic errors on older Linux#276
algojogacor wants to merge 1 commit into
smol-machines:mainfrom
algojogacor:fix/glibc-compat-detection

Conversation

@algojogacor

Copy link
Copy Markdown

Summary

Fixes #228: smolvm fails with cryptic GLIBC_2.39 not found error on Ubuntu 22.04 / WSL.

Problem

The pre-built smolvm-bin binary is compiled on a build machine with GLIBC 2.39+, but users on Ubuntu 22.04 (which ships GLIBC 2.35) receive a cryptic version 'GLIBC_2.39' not found error from the dynamic linker. This is especially common for WSL users who default to Ubuntu 22.04.

Solution

Added explicit GLIBC version compatibility checking to the wrapper script (scripts/smolvm-wrapper.sh):

  1. Uses objdump -T to extract the maximum required GLIBC version from the binary
  2. Reads the system's installed GLIBC version via ldd --version
  3. Compares versions and exits with a clear, actionable error message if incompatible
  4. Provides specific resolution steps (upgrade, build from source, or use Docker)

Before:

$ smolvm --help
/home/user/.smolvm/smolvm-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.39' not found

After:

$ smolvm --help
Error: smolvm requires GLIBC >= 2.39 but your system has GLIBC 2.35

This typically happens on older Linux distributions (e.g., Ubuntu 22.04).
To resolve:
  1. Upgrade to Ubuntu 24.04 or newer, or
  2. Build smolvm from source: https://github.com/smol-machines/smolvm#building-from-source
  3. Use the smolvm Docker image: docker run --rm -it --privileged smolmachines/smolvm

This gracefully handles systems without objdump by falling through to the existing behavior.

Type of Change

  • Bug fix (improved error handling)

Users on older Linux distributions (Ubuntu 22.04, WSL) encounter
a cryptic 'GLIBC_2.39 not found' error when running smolvm because
the pre-built binary is compiled against a newer glibc.

This adds explicit GLIBC version checking to the wrapper script,
which extracts the required GLIBC version from the binary using
objdump, compares it against the system's installed GLIBC, and
provides a clear error message with resolution steps when the
system GLIBC is too old.

Fixes smol-machines#228
Comment thread scripts/smolvm-wrapper.sh
echo "To resolve:" >&2
echo " 1. Upgrade to Ubuntu 24.04 or newer, or" >&2
echo " 2. Build smolvm from source: https://github.com/smol-machines/smolvm#building-from-source" >&2
echo " 3. Use the smolvm Docker image: docker run --rm -it --privileged smolmachines/smolvm" >&2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have a smolvm docker image (which makes sense because smolvm is a replacement for docker)

Comment thread scripts/smolvm-wrapper.sh
echo "This typically happens on older Linux distributions (e.g., Ubuntu 22.04)." >&2
echo "To resolve:" >&2
echo " 1. Upgrade to Ubuntu 24.04 or newer, or" >&2
echo " 2. Build smolvm from source: https://github.com/smol-machines/smolvm#building-from-source" >&2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

building-from-source doesn't exist today but we should have one, i'll add that in the future

@stage-review

stage-review Bot commented May 27, 2026

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 1 individual chapter for you:

Title
1 Add GLIBC version check to wrapper script
Open in Stage

Chapters generated by Stage for commit ebdfd8e on May 27, 2026 9:06pm UTC.

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

smolvm fails to run on Ubuntu 22.04 via WSL: version GLIBC_2.39 not found

2 participants