control: tag -1 - pending On 2017-12-02 03:34, Mikulas Patocka wrote: > > > On Sun, 26 Nov 2017, Aurelien Jarno wrote: > > > > > You mean that even now running 'ldconfig' followed by 'ldd /bin/true' > > > > will give you > > > > libc.so.6 => /lib64/libc.so.6 > > > > instead of > > > > libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 > > > > ? > > > > > > Yes. > > > # ldd /bin/true > > > linux-vdso.so.1 (0x00007ffc62b5a000) > > > libc.so.6 => /lib64/libc.so.6 (0x00007fd870377000) > > > /lib64/ld-linux-x86-64.so.2 (0x00007fd870921000) > > > > > > If I use the --inhibit-cache flag, it points to the correct location: > > > # /lib64/ld-linux-x86-64.so.2 --list --inhibit-cache /bin/true > > > linux-vdso.so.1 (0x00007ffd566e4000) > > > libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f73026c8000) > > > /lib64/ld-linux-x86-64.so.2 (0x00007f7302c73000) > > > > > > Without --inhibit-cache, it points to /lib64/libc.so.6 > > > # /lib64/ld-linux-x86-64.so.2 --list /bin/true > > > linux-vdso.so.1 (0x00007ffd5ad10000) > > > libc.so.6 => /lib64/libc.so.6 (0x00007fc566092000) > > > /lib64/ld-linux-x86-64.so.2 (0x00007fc56663c000) > > > > I am still unable to reproduce this problem. On my system > > lib/x86_64-linux-gnu/ is preferred over lib64. ldconfig uses glob to to > > interpret the "*.conf" in /etc/ld.so.conf, so the files are sorted > > alphabetically and thus the zz_amd64-biarch-compat.conf should appear > > last. > > > > It would be interesting to check at the order in the cache, using > > "ldconfig -p | grep libc.so". Could you please provide that output? > > > > Thanks, > > Aurelien > > # ldconfig -p | grep libc.so > libc.so.6 (libc6,x32, ABI OS: Linux 3.4.0) => > /lib/x86_64-linux-gnux32/libc.so.6 > libc.so.6 (libc6,x86-64, ABI OS: Linux 3.2.0) => /lib64/libc.so.6 > libc.so.6 (libc6,x86-64, ABI OS: Linux 2.6.32) => > /lib/x86_64-linux-gnu/libc.so.6 > libc.so.6 (libc6, ABI OS: Linux 3.2.0) => /lib32/libc.so.6 > libc.so.6 (libc6, ABI OS: Linux 2.6.32) => > /lib/i386-linux-gnu/libc.so.6 > > The problem is caused by the "ABI OS" field - the libraries in /lib64 have > higher field than the libraries in /lib/x86_64-linux-gnu/
Thanks for the details. I did all my tests with libc6:amd64 and libc6-amd64:i386, and the problem is at the end specific to libc6-amd64:x32. On the other hand i was able to reproduce the issue by changing locales, so that's at least one more possibility of this bug to get detected. > If I comment out this piece of code in the function compare in the file > glibc/elf/cache.c, the problem goes away and the linker will prefer > libraries in /lib/x86_64-linux-gnu/ and /lib/i386-linux-gnu/. > > /* > if (e2->osversion > e1->osversion) > return 1; > if (e2->osversion < e1->osversion) > return -1; > */ Some libraries other than libc.so.6 might use this mechanism, so we can't really disable it. On the other hand we can ensure that all libc for a given architecture and version are built for the same kernel version. Aurelien -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurel...@aurel32.net http://www.aurel32.net