Page 1 of 1

Segmentation fault on MagickResizeImage in CLI

Posted: 2015-06-12T13:31:21-07:00
by spiderr
I have a very simple script that thumbnails images on the command line. When MagickResizeImage is called, the script segfaults on termination (everything works, just seg faults when done - I remember a similar issue years ago when you didn't DestroyMagickWand( $magickWand ) things would crash). I have tried php 5.4.42 and php 5.6.10

FWIW, I was testing with this image:


Code: Select all

    $magickWand = NewMagickWand();
    MagickReadImage( $magickWand, "/tmp/0HFF1UYS9S.jpg" );
    // this call causes segfault on exit.
    MagickResizeImage( $magickWand, 100, 78, MW_BesselFilter, 1.00 );
    MagickWriteImage( $magickWand, "/tmp/thumb.jpg" );
    DestroyMagickWand( $magickWand );

Code: Select all

[apache@vice tmp]$ php /tmp/debug.php
Segmentation fault (core dumped)
(gdb) bt
#0  0x00007f87f68e205c in ?? ()
#1  0x00007f87f68e10a0 in ?? ()
#2  0x00007f87ebce6db8 in ?? ()
#3  0x0000000000000000 in ?? ()
CentOS 6.6 with remi RPMs.

Re: Segmentation fault on MagickResizeImage in CLI

Posted: 2015-06-12T14:06:56-07:00
by magick
We're using ImageMagick 6.9.1-5, PHP MagickWand, under Fedora and your program worked fine. We're not sure why it failed for you.