Skip to content

Fix musl misdetection on glibc systems with musl installed (#692) - #740

Merged
xerial merged 1 commit into
mainfrom
fix/musl-detection
Oct 3, 2026
Merged

xerial merged 1 commit into
mainfrom
fix/musl-detection

Conversation

@xerial

@xerial xerial commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #692. Since 1.1.10.8, OSInfo picks the x86_64-musl native library whenever /lib/ld-musl-x86_64.so.1 exists. That file is often present on glibc systems too: it gets installed alongside Grafana or with the musl / musl-tools packages. On those machines the musl build of the library then fails with libc.musl-x86_64.so.1: cannot open shared object file. Reported users include Confluence (CONFSERVER-100761) and Teku.

The new check looks for musl's loader in /proc/self/maps, which shows the C library actually loaded into the running JVM, so having musl installed elsewhere on the system doesn't matter. It also only runs on Linux x86_64; before, the file check ran on every OS and architecture. If /proc can't be read, it falls back to the glibc build, which was the behavior before 1.1.10.8.

This is an alternative to #694, which keys off an IS_MUSL environment variable. With this approach, Alpine users keep automatic detection without setting anything.

Test plan

  • Unit test for isMuslLoaded covering a musl maps file, a glibc maps file and a missing file
  • New CI jobs:
    • eclipse-temurin:17-jdk-alpine must detect x86_64-musl and pass ./sbt test
    • Ubuntu with musl installed must detect x86_64 and pass ./sbt test

🤖 Generated with Claude Code

Checking for /lib/ld-musl-x86_64.so.1 misdetects glibc systems that also
have musl installed (e.g., as a dependency of Grafana), where the
x86_64-musl native library then fails to load (#692). Inspect
/proc/self/maps instead, and only consider musl on Linux x86_64.

Also add CI jobs that run the tests on Alpine and on Ubuntu with musl
installed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the bug label Oct 3, 2026
@xerial
xerial merged commit 35d5e9b into main Oct 3, 2026
11 checks passed
@xerial
xerial deleted the fix/musl-detection branch October 3, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with musl after upgrading to v1.1.10.8

1 participant