Skip to content

Adapt the older versions of symbols whose ABI never changed - #8

Open
buyemune-sys wants to merge 2 commits into
pg83:mainfrom
buyemune-sys:fix/old-symbol-versions
Open

buyemune-sys wants to merge 2 commits into
pg83:mainfrom
buyemune-sys:fix/old-symbol-versions

Conversation

@buyemune-sys

@buyemune-sys buyemune-sys commented Oct 17, 2026 •

Copy link
Copy Markdown

The problem

Some bridge adapters are registered only under the newest glibc version of their symbol. A binary built against an older glibc imports an older version of the same symbol and gets the fail-loud stub instead of the adapter:

glibc bridge: called unimplemented ABI glob64@GLIBC_2.2.5
glibc bridge: called unimplemented ABI pthread_mutex_clocklock@GLIBC_2.30

A real-world case: the static build of Tarantool, built on CentOS 7 (glibc 2.17), aborts in glob64@GLIBC_2.2.5 when box.cfg starts. Also, every pthread_cleanup_push in code built before glibc 2.34 imports __pthread_register_cancel@GLIBC_2.3.3.

How the full list was found

A script (repro/version_gaps.py in our series) mirrors GlibcAdapter::GlibcAdapter(): a version the inventory knows registers as is, an unknown one registers under every inventory version. It then lists names where some glibc versions are not covered and musl has no provider of that name. Names in overrideNames resolve by name for any version, so they are excluded. On main:

symbol registered missing (x86_64) missing (aarch64)
glob64 2.27 2.2.5 2.17
pthread_mutex_clocklock, pthread_cond_clockwait, sem_clockwait 2.34 2.30 2.30
pthread_clockjoin_np 2.34 2.31 2.31
pthread_rwlockattr_setkind_np 2.34 2.2.5 2.17
__pthread_register_cancel, __pthread_unregister_cancel, __pthread_unwind_next 2.34 2.3.3 2.17
pthread_attr_setaffinity_np 2.32 2.3.3, 2.3.4 2.17

The fix

The older version is added for every symbol whose ABI did not change. These are the pthread functions that simply moved from libpthread into libc in 2.34, plus glob64: its pre-2.27 version differs only in how gl_lstat behaves under GLOB_ALTDIRFUNC, which musl does not implement either. On aarch64 the hand-written x86-64 versions fan out to the platform's versions as before, so 2.17 is covered too.

One exception: pthread_attr_setaffinity_np@GLIBC_2.3.3. It is the old ABI without the cpusetsize argument, so it deliberately stays a stub (2.3.4 is added).

After the fix, the script reports only that one case.

Test

The guest (tst/glibc_guest_test.c) uses .symver to call glob64 at the architecture's baseline version (GLIBC_2.2.5 / GLIBC_2.17) and pthread_mutex_clocklock@GLIBC_2.30. Needle: guest old versions glob64=1 clocklock=0.

  • on main: the guest aborts with called unimplemented ABI glob64@GLIBC_2.2.5;
  • with the fix: ./build test passes.

buyemune-sys and others added 2 commits October 20, 2026 15:42
Security updates replaced libapparmor1 4.0.1really4.0.1-0ubuntu0.24.04.7
with .9 and libexpat1 2.6.1-2ubuntu0.4 with ubuntu0.6, and the pool kept
only the new files, so the cold-cache Fetch x86_64 job answers 404 and
every x86-64 job behind it is skipped. Both pins move to the versions
noble-updates ships now; their SHA256s match the archive's Packages index.
The other twelve pins are still served.
Several adapters were registered only under their newest glibc version:
glob64 under GLIBC_2.27, the clock* waits, pthread_clockjoin_np,
pthread_rwlockattr_setkind_np and the cancellation entry points under
the GLIBC_2.34 move into libc. A binary linked against an older glibc
imports glob64@GLIBC_2.2.5, pthread_mutex_clocklock@GLIBC_2.30 or
__pthread_register_cancel@GLIBC_2.3.3 (every pthread_cleanup_push of a
pre-2.34 build), and got the fail-loud stub instead of the adapter. A
Tarantool built on CentOS 7 aborts in glob64 at startup that way.

Each now also answers for the older versions with the same ABI. On
aarch64 the hand-written x86-64 versions fan out to the platform's own
as before, so GLIBC_2.17 is covered too. pthread_attr_setaffinity_np at
GLIBC_2.3.3 predates the cpusetsize argument and stays a stub.

The guest test calls glob64 and pthread_mutex_clocklock at their old
versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@buyemune-sys
buyemune-sys force-pushed the fix/old-symbol-versions branch from 5cc1ba1 to 53e0b9f Compare October 20, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant