Bug#982443: libc6: Inconsistency detected by ld.so: dl-lookup.c: 111: check_match: Assertion `version->filename == NULL || ! _dl_name_match_p (version->filename, map)' failed!
control: reaffect -1 adequate
control: retitle -1 adequate autopkgtests do not work with toolchains defaulting to --as-needed
On 2021-02-10 12:17, Andreas Beckmann wrote:
> Package: libc6
> Version: 2.31-9
> Severity: important
> Control: block 981899 with -1
>
> One of the adequate autopkg tests now triggers an assertion in libc6,
> which is a regression from buster.
> I've extracted that test to build the attached self-contained reproducer.
>
> sid$ make
> mkdir -p tmp
> # missing-version-information
> cc -shared -Wl,--soname=libadequate-test-versionless.so.0 -Wl,--version-script=verscript-global lib.c -o tmp/libadequate-test-versionless.so.0
> ln -sf libadequate-test-versionless.so.0 tmp/libadequate-test-versionless.so
> cc undef.c -Ltmp -o tmp/adequate-test-msvi -ladequate-test-versionless
> cc -shared -Wl,--soname=libadequate-test-versionless.so.0 lib.c -o tmp/libadequate-test-versionless.so.0
> LD_LIBRARY_PATH=tmp ldd -r tmp/adequate-test-msvi
> tmp/adequate-test-msvi: tmp/libadequate-test-versionless.so.0: no version information available (required by tmp/adequate-test-msvi)
> linux-vdso.so.1 (0x00007ffd73deb000)
> libadequate-test-versionless.so.0 => tmp/libadequate-test-versionless.so.0 (0x00007f6c563b1000)
> libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6c561e8000)
> /lib64/ld-linux-x86-64.so.2 (0x00007f6c563bd000)
> Inconsistency detected by ld.so: dl-lookup.c: 111: check_match: Assertion `version->filename == NULL || ! _dl_name_match_p (version->filename, map)' failed!
> make: *** [Makefile:13: all] Error 1
>
> The test builds a binary that is linked against a shared library with
> versioned symbols, but at runtime only a library with unversioned symbols
> is available.
> adequate then looks for the "no version information available" output, but
> nevertheless expects ldd to not fail.
>
>
> buster$ make
> mkdir -p tmp
> # missing-version-information
> cc -shared -Wl,--soname=libadequate-test-versionless.so.0 -Wl,--version-script=verscript-global lib.c -o tmp/libadequate-test-versionless.so.0
> ln -sf libadequate-test-versionless.so.0 tmp/libadequate-test-versionless.so
> cc undef.c -Ltmp -o tmp/adequate-test-msvi -ladequate-test-versionless
> cc -shared -Wl,--soname=libadequate-test-versionless.so.0 lib.c -o tmp/libadequate-test-versionless.so.0
> LD_LIBRARY_PATH=tmp ldd -r tmp/adequate-test-msvi
> tmp/adequate-test-msvi: tmp/libadequate-test-versionless.so.0: no version information available (required by tmp/adequate-test-msvi)
> linux-vdso.so.1 (0x00007ffdd3520000)
> libadequate-test-versionless.so.0 => tmp/libadequate-test-versionless.so.0 (0x00007f32e0977000)
> libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f32e07b2000)
> /lib64/ld-linux-x86-64.so.2 (0x00007f32e0983000)
> buster$ echo $?
This does not seem to be a regression at the glibc level, but is rather
due to the toolchain in bullseye defaulting to --as-needed, which causes
libadequate-test-versionless.so.0 to not be linked anymore with libc:
- The bug *can* be reproduced in buster by using cc -shared
-Wl,--as-needed ...
- The bug can *not* be reproduced in bullseye by using cc -shared
-Wl,--no-as-needed ...
I guess adequate should be fixed accordingly. I am therefore reassigning
the bug.
Aurelien
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://www.aurel32.net
Reply to: