Re: AppendImages () - Segmentation Fault

quanta <[email protected]> Thu, 24 Feb 2011 20:41:03 +0000
Newsgroups gmane.comp.video.image-magick.bugs
Message-ID <[email protected]>
I have compiled the lastest ImageMagick version from Subverion:

$ /usr/local/imagemagick/bin/convert -version
Version: ImageMagick 6.6.7-10 2011-02-24 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features:   

I try to directly convert from command line with 2 images.
The strange thing is if I reverse the order I will got the segfault error:

$ gdb /usr/local/imagemagick/bin/convert
GNU gdb (Gentoo 7.2 p1) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /usr/local/imagemagick/bin/convert...done.
(gdb) run 2.jpg 1.jpg -append 21.jpg
Starting program: /usr/local/imagemagick/bin/convert 2.jpg 1.jpg -append
21.jpg
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0xb7cf3b14 in AppendImages (images=0x80707f0, stack=MagickTrue,
exception=0x804b588) at magick/image.c:551
551              append_indexes[x]=indexes[x];
(gdb) where
#0  0xb7cf3b14 in AppendImages (images=0x80707f0, stack=MagickTrue,
exception=0x804b588) at magick/image.c:551
#1  0xb7b84f7a in MogrifyImageList (image_info=0x8050130, argc=3,
argv=0x805423c, images=0xbfffdbd8, exception=0x804b588)
    at wand/mogrify.c:7633
#2  0xb7b8e147 in MogrifyImages (image_info=0x8050130, post=MagickTrue,
argc=3, argv=0x805423c, images=0xbfffec78,
    exception=0x804b588) at wand/mogrify.c:8570
#3  0xb7b07be1 in ConvertImageCommand (image_info=0x804b628, argc=5,
argv=0x8054238, metadata=0x0, exception=0x804b588)
    at wand/convert.c:2953
#4  0xb7b868b8 in MagickCommandGenesis (image_info=0x804b628,
command=0x80488cc <ConvertImageCommand@plt>, argc=5,
    argv=0xbfffef44, metadata=0x0, exception=0x804b588) at
wand/mogrify.c:169
#5  0x08048a6f in main (argc=5, argv=0xbfffef44) at utilities/convert.c:80

$ /usr/local/imagemagick/bin/convert -verbose 1.jpg 2.jpg -append 12.jpg
1.jpg JPEG 110x74 110x74+0+0 8-bit DirectClass 593KB 0.020u 0:00.019
2.jpg JPEG 110x74 110x74+0+0 8-bit DirectClass 33.2KB 0.000u 0:00.000
1.jpg=>12.jpg JPEG 110x74=>110x148 110x148+0+0 8-bit DirectClass 655KB
0.020u 0:00.330

I also post here the link to my images for you to try and investivate
the problem:

http://www.freeimagehosting.net/uploads/67328e56cd.jpg
http://www.freeimagehosting.net/uploads/149a60f2b7.jpg

On 02/24/2011 03:42 PM, quanta wrote:
> Hi,
>
> I'm running ImageMagick 6.2.8.0-4 on CentOS 5.4.
> PHP 5.3.2
> Apache 2.2.3
>
> Today, I got segfault error in the Apache logs:
>
> Feb 24 13:35:21 SVR015-04 kernel: php[24679]: segfault at 0000000000000000 rip 0000003776ab45da rsp 00007fffc7266e40 error 6
>
> Try to debug Apache with gdb, I got the following backtrace:
>
> #0  0x00002af8f874a5da in AppendImages () from /usr/lib64/libMagick.so.10
> #1  0x00002af8f84586ce in MagickAppendImages () from
> /usr/lib64/libWand.so.10
> #2  0x00002af8f81a3ad8 in zim_imagick_appendimages (ht=<value optimized
> out>, return_value=0x2af8f9ded108,
>     return_value_ptr=<value optimized out>, this_ptr=<value optimized
> out>, return_value_used=<value optimized out>)
>     at /var/tmp/imagick/imagick_class.c:8790
> #3  0x00002af8f03fef29 in ?? () from /etc/httpd/modules/libphp5.so
> #4  0x00002af8f03d544b in execute () from /etc/httpd/modules/libphp5.so
> #5  0x00002af8f03b1ba5 in zend_execute_scripts () from
> /etc/httpd/modules/libphp5.so
> #6  0x00002af8f0362cc8 in php_execute_script () from
> /etc/httpd/modules/libphp5.so
> #7  0x00002af8f0439c2d in ?? () from /etc/httpd/modules/libphp5.so
> #8  0x00002af8e8374a4a in ap_run_handler () from /usr/sbin/httpd
> #9  0x00002af8e8377ec2 in ap_invoke_handler () from /usr/sbin/httpd
> #10 0x00002af8e8382918 in ap_process_request () from /usr/sbin/httpd
> #11 0x00002af8e837fb50 in ?? () from /usr/sbin/httpd
>
> I also try to upgrade to lastest version of ImageMagick (install from binary):
>
> # rpm -qa | grep ImageMagick
> ImageMagick-devel-6.6.7-9
> ImageMagick-6.6.7-9
>
> but I got the below error when checking imagick extension (version 3.0.1) for PHP:
>
> # php -m | grep imagick
> PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/imagick.so' - libMagick.so.10: cannot open shared object file: No such file or directory in Unknown on line 0
>
> Making a symlink and it was loaded, but gdb still through a backtrace related to libMagick.so.10:
>
> #0  0x00002b26ec86cb5a in ?? () from /usr/lib64/libMagick.so.10
> #1  0x00002b26ed8b8f52 in ?? () from /usr/lib64/libgomp.so.1
> #2  0x00002b26de01f4a7 in start_thread () from /lib64/libpthread.so.0
> #3  0x00002b26de50cc2d in clone () from /lib64/libc.so.6
>
> Any help will be appreciated.
>
>
>
>
>
>