Ubuntu's multisearch surprise
Ubuntu's multisearch surprise
Posted Aug 10, 2009 18:53 UTC (Mon) by nix (subscriber, #2304)In reply to: Ubuntu's multisearch surprise by mjthayer
Parent article: Ubuntu's multisearch surprise
by one version of a shared library end up being passed to another version
in the same address space, or if both of them are contending trying to
manage some shared resource (classic examples, both from libc: wtmp and
the malloc arena).
What RTLD_LOCAL fixes is the 'whoops, symbol name clashes between totally
different shared libraries because they dared to use a symbol with the
same name' problem.
Posted Aug 10, 2009 19:08 UTC (Mon)
by mjthayer (guest, #39183)
[Link] (2 responses)
Posted Aug 11, 2009 9:22 UTC (Tue)
by ringerc (subscriber, #3071)
[Link] (1 responses)
That makes it hard when libraries at the same linkage "level" (say libh and libi) want to pass around objects that may, either overtly or behind the scenes, rely on shared static data (library-internal caches or the like) in a library (say libj) they both use. Of course, they can't pass libj objects across library boundaries anyway unless they know they're using at least a compatible version of libj, since their layout might and/or meaning not be compatible, so they may as well share the same instance of libj's rw data segment too, as if it were RTLD_GLOBAL.
This sort of thing is very common in things like application frameworks (qt/gtk/etc) and plugins.
I seem to remember that Mac OS X tackles this by defaulting to something like RTLD_LOCAL linkage, but allowing objects to specify global linkage instead. That's vague memory only though, and I haven't hunted down any documentation to confirm it.
Posted Aug 11, 2009 9:34 UTC (Tue)
by mjthayer (guest, #39183)
[Link]
Ubuntu's multisearch surprise
Ubuntu's multisearch surprise
Ubuntu's multisearch surprise