[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: png2/3 problem apparently successfully solved with -Bsymbolic



On Tue, Aug 20, 2002 at 09:25:06PM +0200, Luca Barbieri wrote:
> I propose to do the following to solve the libpng2/3 problem. I've
> recompiled libpng2. libpng3 and libgtk2.0-0png3 locally and the system
> seems to work correctly.
>         1. Recompile libpng2 and libpng3 with -Bsymbolic
>         2. Recompile all libraries that use either libpng2 or libpng3 to
>            explicitly link to them and to use -Bsymbolic
>         3. Recompile all programs that use either libpng2 or libpng3 to
>            explicitly link to them  [all programs should already do
>            this]
>         4. Make either libgtk2.0-0 or libgtk2.0-0png3 a dummy package
>            depending on the other

> Note1: for GTK+ 2.0, only the png loader plugin needs to be recompiled
> with -Bsymbolic

> Note2: "recompile with -Bsymbolic" means "add -Wl,-Bsymbolic to the
> flags passed to the compiler in the linking stage, rebuild and upload
> the new package"

> Doing this will allow applications using GTK+ to use either libpng2 or
> libpng3 and still work correctly.

> I'll now explain what the problem is and why this solution works.
> The problem is that libpng2 and libpng3 have symbols with different
> names and we want to have both loaded in the same address space.

> Symbols are resolved by the GNU dynamic linker, part of glibc, that
> normally uses the same search list for all modules.
> This means that normally when two symbols have the same name everything
> will use the symbol in the first module loaded.
> What we instead want is to use the symbol in the library that the
> calling module links to.

>sing -Bsymbolic ensures that whenever the libpng library makes a call to
one of its own functions, the symbol is resolved internally instead of to
another version of libpng that's loaded.  This may account for a majority
of the segfaults that people are seeing.  It does not affect how symbols
are resolved when something /outside/ of libpng tries to call a function
belonging to libpng.

If the ABI has changed between libpng2 and libpng3 (which it supposedly
has), there is still a danger of segfaults whenever both of these
libraries are loaded into memory -- with or without -Bsymbolic.

Steve Langasek
postmodern programmer

Attachment: pgp_i0JM2NflG.pgp
Description: PGP signature


Reply to: