Discussion:
perlmagick segmentation fault on CentOS 5.5
Michael Howard
2011-02-02 22:59:29 UTC
Permalink
I am getting a segmentation fault using perl Image::Magick on CentOS 5.5

CentOS 5.5 repositories are out of date, so I installed the following
from source .tar.gz files

ImageMagick-6.6.7-3
ghostscript-9.00
ImageMagick-6.6.7-3/PerlMagick

ImageMagick itself seems to be running OK, and dealing properly with PDF files.

I ran the tests after doing the makes. With PerlMagick there were two
tests that displayed a small X window and halted. When I closed the
respective windows each of these tests registered it as a failure.
Other than that everything worked OK. I ran the PerlMagick/demo make
and it worked just fine, displaying the window with the various
transformed images.

I am a somewhat experienced perl programmer, but this is the first
time I have used PerlMagick. Simple perl scripts using Image::Magick
seem to run OK; I can Read() image files and perform Crop()
transformations.

However, upon exit I am getting a segmentation fault. Doesn't matter
whether I actually allocate an Image::Magick object or not. Simply
'use Image::Magick' will cause the segmentation fault upon exit.

I need to fix this problem because A) it is the right thing to do & B)
the segmentation fault messes up the exit code, which I need to return
to the calling scripts.

I don't have any experience trying to diagnose this type of thing.

Any advice / pointers would be greatly appreciated.


Michael
d***@imagemagick.org
2011-02-03 00:27:14 UTC
Permalink
Post by Michael Howard
I am getting a segmentation fault using perl Image::Magick on CentOS 5.5
Post the output of these commands:

gdb perl
run myscript.pl
where
Michael Howard
2011-02-03 00:58:18 UTC
Permalink
On Wed, Feb 2, 2011 at 7:27 PM,
Post by Michael Howard
I am getting a segmentation fault using perl Image::Magick on CentOS 5.5
 gdb perl
 run myscript.pl
 where
Thank you for your prompt response

Program received signal SIGSEGV, Segmentation fault.
0x0037d7ee in ?? () from /lib/libselinux.so.1
(gdb) where
#0 0x0037d7ee in ?? () from /lib/libselinux.so.1
#1 0x00378f22 in ?? () from /lib/libselinux.so.1
#2 0x003715c2 in selinux_file_context_cmp () from /lib/libselinux.so.1
#3 0x00384eec in selinux_file_context_cmp () from /lib/libselinux.so.1
#4 0x080ca1c8 in ?? ()
#5 0xbfffe5f8 in ?? ()
#6 0x0037156a in selinux_file_context_cmp () from /lib/libselinux.so.1
#7 0x00384ff4 in selinux_file_context_cmp () from /lib/libselinux.so.1
#8 0x002c2240 in _rtld_local () from /lib/ld-linux.so.2
#9 0xbfffe608 in ?? ()
#10 0x0037e51c in _fini () from /lib/libselinux.so.1
Backtrace stopped: frame did not save the PC
(gdb)


I see references to libselinux ... I have selinux disabled on this machine:

[***@localhost perlmagick]$ grep SELINUX= /etc/selinux/config
# SELINUX= can take one of these three values:
SELINUX=disabled



Michael
d***@imagemagick.org
2011-02-03 01:24:57 UTC
Permalink
Post by Michael Howard
I see references to libselinux
The stack trace shows the problem is not with ImageMagick / PerlMagick
but with libselinux, a system library. PerlMagick does not make calls
to libselinux.
Michael Howard
2011-02-03 02:01:40 UTC
Permalink
On Wed, Feb 2, 2011 at 8:24 PM,
Post by d***@imagemagick.org
Post by Michael Howard
I see references to libselinux
The stack trace shows the problem is not with ImageMagick / PerlMagick
but with libselinux, a system library.  PerlMagick does not make calls
to libselinux.
I agree ... that is what it looks like at first glance.

a few things make me question this a bit.

1. I have SELINUX disabled
2. After item 10 on the stack it says that the frame did not save the
PC ... seems strange to me
3. I have used about 2 dozen other perl modules on this system and
have not had this issue. Admittedly, they probably are not as complex
as PerlMagick


If I get a chance I will do a clean install on another system.

Thanks for your help,
Michael

Loading...