Repository navigation
Adapt the older versions of symbols whose ABI never changed - #8
Open
buyemune-sys wants to merge 2 commits into
Open
buyemune-sys wants to merge 2 commits into
buyemune-sys wants to merge 2 commits into
Conversation
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
force-pushed
the
fix/old-symbol-versions
branch
from
October 20, 2026 08:11
5cc1ba1 to
53e0b9f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
A real-world case: the static build of Tarantool, built on CentOS 7 (glibc 2.17), aborts in
glob64@GLIBC_2.2.5whenbox.cfgstarts. Also, everypthread_cleanup_pushin 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.pyin our series) mirrorsGlibcAdapter::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 inoverrideNamesresolve by name for any version, so they are excluded. Onmain:glob64pthread_mutex_clocklock,pthread_cond_clockwait,sem_clockwaitpthread_clockjoin_nppthread_rwlockattr_setkind_np__pthread_register_cancel,__pthread_unregister_cancel,__pthread_unwind_nextpthread_attr_setaffinity_npThe 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 howgl_lstatbehaves underGLOB_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 thecpusetsizeargument, 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.symverto callglob64at the architecture's baseline version (GLIBC_2.2.5/GLIBC_2.17) andpthread_mutex_clocklock@GLIBC_2.30. Needle:guest old versions glob64=1 clocklock=0.main: the guest aborts withcalled unimplemented ABI glob64@GLIBC_2.2.5;./build testpasses.