symbol versioning of private libraries builds

Stefan (metze) Metzmacher metze at samba.org
Fri Dec 10 02:49:07 MST 2010


Hi Tridge,

> I don't think this is correct.
> 
> Imagine the situation where an application, such as openchange, uses
> system talloc, but also uses ldb, which happens to use a private
> library version of talloc.

For that's not a valid setup, all components have to use the system talloc
in that case.

> By using the same symbol versions in both libraries, we ensure that we
> don't instantiate two versions of those symbols. With your proposed
> patch it would be possible for the application to mix versions of
> talloc. That could lead to nasty crashes.

If we have loaded two versions of talloc are used we have always a
problem...
And the current schema doesn't solve that.

Think about this:

The system talloc is version 2.0.2 and the current samba one would be 2.1.0
where we added a new function 'talloc_do_something()'.

If we have loaded both versions of talloc, we may use some functions of
the system library and the talloc_do_something() from the private one.

As talloc is a special case, I can't see how we can solve this problem,
the only way is that the admin or packager makes sure to only use a system
talloc!

But for other libraries without impact on the whole application,
we should make sure that we only use symbols from the private version
of the library, instead of taking the old symbols from the system
library and only
the new symbols from the private one.

For libraries like tdb or ldb it's ok, if one component uses the system tdb
to open component1.tdb while component2 uses the private one to access
component2.ldb.
And my schema would make sure that component1 would consistently use the
symbols
from the system library while component2 would consitently use the
symbols from the private
library.

metze
>  > can you take a look at the 2 top commits in this branch
>  > http://gitweb.samba.org/?p=metze/samba/wip.git;a=shortlog;h=refs/heads/master4-fix2
>  > 
>  > Without them the private (bundled) libraries would provide symbols
>  > in their public namespace which would conflict with installed
>  > system libraries.
>  >
>  > The change to preifx the namespace with PRIVATE_, prevents using the public
>  > namespace of ldb e.g. LDB_0.9.20 for the bundled tevent, tdb and talloc
>  > libraries.
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20101210/5bced708/attachment.pgp>


More information about the samba-technical mailing list