This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug admin/11064] New: ldconfig doesn't error out/warn when multiple libraries export the same symbol
- From: "marc_soft at merlins dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 8 Dec 2009 17:29:24 -0000
- Subject: [Bug admin/11064] New: ldconfig doesn't error out/warn when multiple libraries export the same symbol
- Reply-to: sourceware-bugzilla at sourceware dot org
Resending this problem here per request from ldonfig maintainer.
Note that I know ldconfig isn't supposed to support library conflicts
but hopefully it can be changed to do something sane (erroring out)
as opposed to non deterministic (silently pick the first one in readdir
without pointing out the conflict).
Thanks,
Marc
Subject: ldconfig overwrote ld-linux.so.2 with a link to a different libc
Hi Andreas,
If you agree this is a problem, please let me know where I should file a
bug, and I'd be happy to.
We had a fun day at google today after we pushed a symlink to the linux
loader of an hermetic libc we have in some other directory /usr/grte/foo/
[root@anar20 /lib]# readelf -d ld-2.2.2.so ld-grte1.so.2 | grep SONAME
0x0000000e (SONAME) Library soname: [ld-linux.so.2]
0x0000000e (SONAME) Library soname: [ld-linux.so.2]
[root@anar20 /lib]# ls -l ld-grte1.so.2
lrwxrwxrwx 1 root root 30 Nov 23 16:46 ld-grte1.so.2 ->
/usr/grte/v1/lib/ld-linux.so.2
We have this so that binaries can be patched to use /lib/ld-grte1.so.2
instead of /lib/ld-2.2.2.so if they need a newer libc while we work on
upgrading the main system libc, which is a fair amount of work due to
dependencies and GNU tools that like to change their interface in non
backward compatible ways.
Anyway, ldconfig seems to do a readdir in /lib and depending on the directory
ordering, it will take ld-grte1.so.2 and symlink to /lib/ld-linux.so.2
which is very bad since it upgrades the libc for the entire system.
It actually got much worse where on systems running libc 2.7, the default
libc thereby got downgraded to 2.3.3, which broke a bunch of things.
Shouldn't ldconfig realize that two .so's that happen to both provide
ld-linux.so.2 is a bad thing and at least output a warning when it runs?
Also, sorting the readdir output would have made the error deterministic.
We got bitten because it worked in testing and then randomly failed on some
machines due to ext3 btree directory ordering that can return new library in
front of another one.
--
Summary: ldconfig doesn't error out/warn when multiple libraries
export the same symbol
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: admin
AssignedTo: roland at gnu dot org
ReportedBy: marc_soft at merlins dot org
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=11064
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.