Laszlo (Laca) Peter wrote:
> On Fri, 2007-05-11 at 00:04 +0100, Peter Tribble wrote:
>   
>> On 5/10/07, Laszlo (Laca) Peter <laca at sun.com> wrote:
>>     
>>> The real trouble is what happens when multiple version of the same
>>> lib meet in an executable.  It happens sometimes and there's no
>>> easy way to avoid or fix it.  Actual examples are the acroread crash
>>> (caused by a libz collision) and currently various GNOME apps
>>> crash due to a clash between libexpat in Python and in /usr/sfw.
>>> The lower level the library, the higher the probability that it'll
>>> cause troubles.  Tck/Tk is probably okay in this regard, but where
>>> do you draw the line?
>>>       
>> I don't know. But I think something's going to have to be worked
>> out, and I keep bringing it up in the hope that someone way
>> smarter than myself will work out a way to cleanly support
>> multiple versions.
>>     
>
> Let me Cc tools-linking, maybe there is some linker magic that
> can help.  AFAIR direct binding can help in some cases.
> We certainly can't solve this problem with just file system
> namespacing.
>
> Laca
>
>
> _______________________________________________
> sfwnv-discuss mailing list
> sfwnv-discuss at opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/sfwnv-discuss
>   
The basic problem is dependencies between libraries:

Suppose we rev. libfoo.so.1.  We create libfoo.so.2 and leave libfoo.so.1
in the file system:

    libfoo.so.1
    libfoo.so.2
    libfoo.so -> libfoo.so.2

Imagine another library, libbar.  It doesn't change:
    libbar.so.1
    libbar.so -> libbar.so.1

Further imagine that libbar depends upon libfoo.  Since these are all built
and delivered together, that's a dependency on libfoo.so.2.

Now, since we must have a good imagination by now, consider an application
built on the previous release.  It depends upon libfoo and libbar: 
libfoo.so.1
and libbar.so.1.  When it links on the current release we have:

    application -> libfoo.so.1
                      -> libbar.so.1 -> libfoo.so.2

(the arrows are now dependencies, where above they were symlinks.)

Yikkes!  We are trying to load two versions of libfoo!  Not nice.

The fairly obvious answer is that we should have rev'ed libbar to
libbar.so.2, just because a library it is dependent upon rev'ed.
With just libfoo and libbar, this isn't too bad, but consider the
multiple levels of libraries present.  Its just not practical to
rev. anything but the leaf node libraries.

I hope this helps.

- jek3


Reply via email to