Menu

#468 --enable-symbol-prefix does not prevent clashes with libMagick++ or libMagickWand?

v1.0_(example)
closed-fixed
None
5
2017-09-16
2017-09-16
Dan Kegel
No

Building graphicsmagick 1.3.26 with --enable-shared --disable-static --enable-symbol-prefix
and then looking at the symbols in the shared libraries finds some not prefixed with Gm...
and have same name as those in ImageMagick. In particular:

a) libGraphicsMagickWand.so has four symbols that overlap:

$ readelf -s /usr/lib/x86_64-linux-gnu/libMagickWand-6.Q16.so | grep GLOBAL | awk '{print $8}' > wand.txt
$ fgrep -w -f wand.txt libGraphicsMagickWand.so.bad
MagickAutoOrientImage
MagickClearException
MagickGetImageOrientation
MagickSetImageOrientation

b) libGraphicsMagick++.so has total overlap with the ImageMagick version. The Gm trick needs to be applied to the namespace, too, I think.

Here's how the above were checked:

$ for a in .so; do nm -C $a | grep -w T | egrep -iv 'T Gm|T _Gm|T _fini|T _init' | sed 's/. T //' > $a.bad ; done
$ head *.bad
==> libGraphicsMagick.so.bad <==
DestroyJNGInfo
DisassociateBlob
InitializeLogInfoPost
LogPALMHeader
MagickAtoFChk
MagickAtoIChk
MagickAtoLChk
MagickAtoUIChk
MagickAtoULChk
_MagickError

==> libGraphicsMagick++.so.bad <==
MagickPlusPlusDestroyMagick
Magick::depthImage::depthImage(unsigned int)
Magick::depthImage::depthImage(unsigned int)
Magick::ErrorCache::ErrorCache(std::__cxx11::basic_string<char, std::char_traits\<char="">, std::allocator\<char> > const&)
Magick::ErrorCache::ErrorCache(std::__cxx11::basic_string<char, std::char_traits\<char="">, std::allocator\<char> > const&)
Magick::ErrorCache::~ErrorCache()
Magick::ErrorCache::~ErrorCache()
Magick::ErrorCache::~ErrorCache()
Magick::ErrorCoder::ErrorCoder(std::__cxx11::basic_string<char, std::char_traits\<char="">, std::allocator\<char> > const&)
Magick::ErrorCoder::ErrorCoder(std::__cxx11::basic_string<char, std::char_traits\<char="">, std::allocator\<char> > const&)</char></char,></char></char,></char></char,></char></char,>

==> libGraphicsMagickWand.so.bad <==
MagickAutoOrientImage
MagickClearException
MagickGetImageOrientation
MagickOperatorImageChannel
MagickRemoveImageOption
MagickSetImageGeometry
MagickSetImageOrientation

$ for a in .bad; do fgrep -w -f $a /usr/lib/x86_64-linux-gnu/.so; done
Binary file /usr/lib/x86_64-linux-gnu/libMagickCore-6.Q16.so matches
Binary file /usr/lib/x86_64-linux-gnu/libMagick++-6.Q16.so matches
Binary file /usr/lib/x86_64-linux-gnu/libMagickWand-6.Q16.so matches

Fortunately, libGraphicsMagick.so seems fine at the moment; _ was added as a prefix
in a few places, so there's no actual overlap.

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2017-09-16
    • status: open --> closed-fixed
    • assigned_to: Bob Friesenhahn
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2017-09-16

    Fixed by Mercurial changeset 15173:99a4407ccce7. Thanks for the report.

    However, Magick++ will remain as it is since I am the author of it and I did not provide ownership of it to ImageMagick Studio. I was at least willing to change the library name under Unix type systems so it did not collide.

     

Log in to post a comment.

MongoDB Logo MongoDB