Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 93078 - perl module for ImageMagick(perlmagick) crashes with "undefined symbol: InitializeMagick"
Summary: perl module for ImageMagick(perlmagick) crashes with "undefined symbol: Initi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Michael Cummings (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-18 08:42 UTC by Lars Lynch
Modified: 2005-06-06 09:11 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Lynch 2005-05-18 08:42:22 UTC
When using the perl module included with ImageMagick(perlmagick), it crashes with:
perl: symbol lookup error:
/usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux/auto/Image/Magick/Magick.so:
undefined symbol: InitializeMagick

I attempted to compile the package by hand:
Step 1: untar ImageMagick-6.2.2-3.tar.bz2 from distfiles
Step 2: default ./configure only adding CFLAGS="-O3 -march=k8
-fomit-frame-pointer -pipe"
Step 3: compile
Step 4: enter in the PerlMagick subdirectory
Step 5: examine the Makefile.PL per the Readme.txt, which says to change the
LIBS value in Makefile.PL by hand
Step 6: delete some weird looking lib entries from LIBS (--rpath and -Wl,)
LIBS before: 'LIBS'      => ['-L/usr/local/lib -lMagick -L/usr/lib64
-L/usr/lib64 -Wl,--rpath -Wl,/usr/lib64 -lfreetype -lz -L/usr/lib -ltiff -lfree
type -ljpeg -lpng -ldpstk -ldps -lXext -lXt -lSM -lICE -lX11 -lbz2 -lxml2 -lz
-lpthread -lm -lpthread'],
LIBS after: 'LIBS'       => ['-L/usr/local/lib -lMagick -L/usr/lib64
-L/usr/lib64  -lfreetype -lz -L/usr/lib -ltiff -lfreetype -ljpeg -lpng -ldpstk
-ldps -lXext -lXt -lSM -lICE -lX11 -lbz2 -lxml2 -lz -lpthread -lm -lpthread'],

Step 7: perl Makefile.PL
Step 8: make
Step 9: make test(fails a bunch because it wants gs(ghostscript) which i don't have
Step 10: make install (notice it installs by default to
/usr/lib/perl5/site_perl/5.8.5/x86_64-linux/auto/Image/Magick/Magick.so instead
of  /usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux/auto/Image/Magick/Magick.so 
Step 11: rename the broken
/usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux/auto/Image/Magick/Magick.so to get
it out of the way
Step 12: Success. Module works perfectly

Reproducible: Always
Steps to Reproduce:
1. Install ImageMagick with perl USE flag
2. add line "use Image::Magick" to any perl script
3.

Actual Results:  
execution aborted with:
perl: symbol lookup error:
/usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux/auto/Image/Magick/Magick.so:
undefined symbol: InitializeMagick

Expected Results:  
No error
Comment 1 Michael Cummings (RETIRED) gentoo-dev 2005-05-18 08:47:02 UTC
That error is indicative of problems we were having when they were separate 
packages but imagemagick was still building a bad perl module and dropping it 
in site_perl. Can you grep perl from the CONTENTS file 
in /var/db/pkg/media-gfx/imagemagick*/ for me? Also - did you have a previous 
copy of either imagemagick or perlmagick installed? 
Comment 2 Lars Lynch 2005-05-19 02:35:39 UTC
Here is the grep requested by mcummings: 
grep perl /var/db/pkg/media-gfx/imagemagick*/CONTENTS
obj /usr/share/doc/ImageMagick-6.2.2/www/perl-magick.html
70f4c8fc71238fc44764ce7ace64815c 1116346639
dir /usr/share/perl
dir /usr/share/perl/gentoo-pods
dir /usr/share/perl/gentoo-pods/5.8.5
obj /usr/share/perl/gentoo-pods/5.8.5/imagemagick-6.2.2.3.pod
64596b0254533798358b8df63986a663 1116346639
obj /usr/share/perl/gentoo-pods/5.8.5/imagemagick-6.2.2.3.pod.arch
64596b0254533798358b8df63986a663 1116346639
dir /usr/lib/perl5
dir /usr/lib/perl5/vendor_perl
dir /usr/lib/perl5/vendor_perl/5.8.5
dir /usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux
dir /usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux/auto
dir /usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux/auto/Image
dir /usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux/auto/Image/Magick
obj /usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux/auto/Image/Magick/Magick.so
8e8fec9c569dde9466a065b348ecce3e 1116346639
obj /usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux/auto/Image/Magick/Magick.bs
d41d8cd98f00b204e9800998ecf8427e 1116346639
obj /usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux/auto/Image/Magick/autosplit.ix
42945b7885e4d88de21d315d4b173b73 1116346639
obj /usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux/auto/Image/Magick/.packlist
f7b4e865b51ad31f19719d7046da0098 1116346639
dir /usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux/Image
obj /usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux/Image/Magick.pm
a462b2f0b4c82eb49495c5c5f5233a58 1116346639
dir /usr/lib/perl5/5.8.5
dir /usr/lib/perl5/5.8.5/x86_64-linux

This is from a new amd64 gentoo install from stage3 as of May 16,2005, with a
fresh portage tree.  Neither imagemagick nor perlmagick(perlmagick was not even
in the portage tree) was previously installed.
Comment 3 Michael Cummings (RETIRED) gentoo-dev 2005-05-19 03:11:43 UTC
Adding the amd64 team to this since for now this seems specific to that arch 
(no reported problems on other arch's and I can't dup this on my x86 or sparc). 
 
amd64 folks - can you confirm this bug? Thanks! 
 
 
Lars - thanks :) When perlmagick was in the tree, that error would pop up due 
to a problem in the imagemagick ebuild building the perl support, then 
perlmagick installing separately and getting all confused on which .so to load 
(obviously not the case here). 
Comment 4 Carlos Silva (RETIRED) gentoo-dev 2005-05-19 04:09:53 UTC
Bug confirmed in amd64 :) removing from CC
Comment 5 Vincent Rivellino 2005-05-30 14:30:03 UTC
I have this same problem on a x86 system.

A Perl cgi script uses Image::Magick, and a perl -c of the script yields:

--
perl: symbol lookup error:
/usr/lib/perl5/vendor_perl/5.8.5/i686-linux/auto/Image/Magick/Magick.so:
undefined symbol: InitializeMagick
--

This system was installed using the x86 stage1 install roughly 3 weeks ago.
Emerge info is below.

--
Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.3.5-20050130,
glibc-2.3.4.20041102-r1, 2.6.11-genR8-sp1 i686)
=================================================================
System uname: 2.6.11-genR8-sp1 i686 AMD Athlon(tm) XP 2400+
Gentoo Base System version 1.4.16
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, May 12 2005, 09:43:28)]
dev-lang/python:     2.3.5
sys-apps/sandbox:    [Not Present]
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r7
sys-devel/libtool:   1.5.16
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -fforce-addr -pipe
-finline-functions -frename-registers -fprefetch-loop-arrays"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/share/config /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -fforce-addr -pipe
-finline-functions -frename-registers -fprefetch-loop-arrays"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.mirrors.tds.net/gentoo
ftp://pandemonium.tiscali.de/pub/gentoo/ ftp://gentoo.ccccom.com
http://gentoo.ccccom.com"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="x86 3dnow acpi apache2 arts bash-completion berkdb bitmap-fonts bzlib crypt
curl emboss encode foomaticdb fortran gd gdbm gif gmp gpm gtk imagemagick imap
imlib innodb ipv6 jpeg libg++ libwww mad maildir mbox mikmod milter mmap mmx mng
motif mp3 mysql ncurses nls oggvorbis pam pdflib perl php png python readline
sasl spell sse ssl symlink tcpd tiff truetype-fonts type1-fonts vhosts xml xml2
xmms xpm zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
--

--
# grep perl performed on /var/db/pkg/media-gfx/imagemagick*/CONTENTS
dir /usr/lib/perl5
dir /usr/lib/perl5/5.8.5
dir /usr/lib/perl5/5.8.5/i686-linux
dir /usr/lib/perl5/vendor_perl
dir /usr/lib/perl5/vendor_perl/5.8.5
dir /usr/lib/perl5/vendor_perl/5.8.5/i686-linux
dir /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/auto
dir /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/auto/Image
dir /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/auto/Image/Magick
obj /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/auto/Image/Magick/Magick.bs
d41d8cd98f00b204e9800998ecf8427e 1117486603
obj /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/auto/Image/Magick/Magick.so
30533cb7da196fd2f0613bc72d7b0866 1117486603
obj /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/auto/Image/Magick/autosplit.ix
42945b7885e4d88de21d315d4b173b73 1117486603
obj /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/auto/Image/Magick/.packlist
c6fd97b236e26ec15b2b12fbf5eb9f39 1117486603
dir /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Image
obj /usr/lib/perl5/vendor_perl/5.8.5/i686-linux/Image/Magick.pm
a462b2f0b4c82eb49495c5c5f5233a58 1117486603
obj /usr/share/doc/ImageMagick-6.2.2/www/perl-magick.html
70f4c8fc71238fc44764ce7ace64815c 1117486603
dir /usr/share/perl
dir /usr/share/perl/gentoo-pods
dir /usr/share/perl/gentoo-pods/5.8.5
obj /usr/share/perl/gentoo-pods/5.8.5/imagemagick-6.2.2.3.pod.arch
2b1f35f96a5418d4c96817d7ac9ea949 1117486603
obj /usr/share/perl/gentoo-pods/5.8.5/imagemagick-6.2.2.3.pod
2b1f35f96a5418d4c96817d7ac9ea949 1117486603
--

I have not yet attempted to install ImageMagick by hand as the original
submitter did.
Comment 6 Michael Cummings (RETIRED) gentoo-dev 2005-05-30 16:53:28 UTC
Now that I (sadly) have a fresh 2005.0 install, I can dup this bug. I'm working 
it. 
Comment 7 Michael Cummings (RETIRED) gentoo-dev 2005-05-30 22:21:09 UTC
Graphics folks (Karol in particular) - I'd welcome some input on how to handle 
this without re-invoking the split of perlmagick. Here's where I'm at: 
 
Perlmagick is only building correctly if imagemagick is already on the live 
system (you can get this out of the README under the perlmagick, but I've 
struggled not to believe them tonight). I've tried every trick I can think of 
and the only one that has worked so far is if I push the building of the perl 
module into pkg_postinst() - which pretty much defeats the purpose of having 
this build in a sandbox, drops the ability to track and/or remove perlmagick on 
an unmerge, and basically means we've only saved a few hassles from just 
splitting it out again. Maybe I'm just not grokking a way of stripping out 
the /var/tmp/* portions of a shared object? 
 
In my defense, when I first tested this merger of the two ebuilds, it was a few 
imagemagick versions ago (6.2.1.5) - I/perl herd wasn't asked to test it on 
subsequent releases, so we didn't, and I'd swear I tried every variation of an 
install with the early <=6.2.1.5 to verify it would work. At this point though 
I can't be certain of that - don't know how I would have missed this behaviour 
(to dup, unmerge all of imagemagick, re-merge, and try the perlmagick portions) 
Comment 8 Karol Wojtaszek (RETIRED) gentoo-dev 2005-06-06 09:11:55 UTC
Fixed in 6.2.2.3-r1 ebuild. Thanks for help.