"Segmentation fault" using writeImage()
Posted: 2015-10-21T03:20:52-07:00
Hi all,
Setup:
CentOS 6.7
php 5.3.3
ImageMagick 6.7.2-7 2015-07-23
php-pecl-imagick-2.2.2-5.el6.x86_64 (EPEL repo)
I have been using command line tools (i.e.: from Bash) for a long time on this server to manipulate images using ImageMagick, and it's worked fine.
However, I now want to use the Imagick PHP extension, so installed it (as per guides such as http://tecadmin.net/install-imagemagick-on-linux/#), but whenever I run my test PHP, I always receive the same error when it tries to save the image out:
My PHP test script is:
This is what I see in my /var/log/messages:
Is this a known problem? Or am I missing something stupid?
I have tried re-installing, even using php-magickwand instead of php-pecl-imagick, but the same fault appears. Oh, I've also tried removing php-pecl-imagick and installing it from 'pecl install imagick'. While it installed fine, I still received the same error.
I'm kinda at my limit with troubleshooting it, so any suggestions would be very much appreciated.
Thank you,
Elliot
Setup:
CentOS 6.7
php 5.3.3
ImageMagick 6.7.2-7 2015-07-23
php-pecl-imagick-2.2.2-5.el6.x86_64 (EPEL repo)
I have been using command line tools (i.e.: from Bash) for a long time on this server to manipulate images using ImageMagick, and it's worked fine.
However, I now want to use the Imagick PHP extension, so installed it (as per guides such as http://tecadmin.net/install-imagemagick-on-linux/#), but whenever I run my test PHP, I always receive the same error when it tries to save the image out:
Code: Select all
Segmentation fault (core dumped)
Code: Select all
<?php
function funcMakeThumb($vFullImagePath) {
echo 'Setting object...'.PHP_EOL;
$imagick = new Imagick(realpath($vFullImagePath));
echo 'Resizing...'.PHP_EOL;
$imagick->thumbnailImage(100, 100);
echo 'Writing image out to '.pathinfo($vFullImagePath,PATHINFO_DIRNAME).DIRECTORY_SEPARATOR.pathinfo($vFullImagePath,PATHINFO_BASENAME).'.thumb.'.pathinfo($vFullImagePath,PATHINFO_EXTENSION).'...'.PHP_EOL;
$imagick->writeImage(pathinfo($vFullImagePath,PATHINFO_DIRNAME).DIRECTORY_SEPARATOR.pathinfo($vFullImagePath,PATHINFO_BASENAME).'.thumb.'.pathinfo($vFullImagePath,PATHINFO_EXTENSION));
}
funcMakeThumb('/var/www/haylo.hayley-group.co.uk/images/user.gif');
?>
Code: Select all
Oct 21 11:16:39 svr-h002607 kernel: php[3992]: segfault at 32b9e0f05c ip 00000032b9e0f05c sp 00007f4f3b47ddb8 error 14
Oct 21 11:16:39 svr-h002607 kernel: php[3990]: segfault at 32b9e0f062 ip 00000032b9e0f062 sp 00007f4f3c87fdb8 error 14
Oct 21 11:16:39 svr-h002607 kernel: php[3988]: segfault at 32b9e0f05e ip 00000032b9e0f05e sp 00007f4f3dc81db8 error 14
Oct 21 11:16:39 svr-h002607 kernel: php[3991]: segfault at 32b9e0f05e ip 00000032b9e0f05e sp 00007f4f3be7edb8 error 14 in libresolv-2.12.so[32ba200000+16000] in libresolv-2.12.so[32ba200000+16000]
Oct 21 11:16:39 svr-h002607 kernel:
Oct 21 11:16:39 svr-h002607 kernel: in libresolv-2.12.so[32ba200000+16000]
Oct 21 11:16:39 svr-h002607 kernel: in libresolv-2.12.so[32ba200000+16000]
Oct 21 11:16:40 svr-h002607 abrt[3993]: Saved core dump of pid 3987 (/usr/bin/php) to /var/spool/abrt/ccpp-2015-10-21-11:16:39-3987 (58740736 bytes)
Oct 21 11:16:40 svr-h002607 abrtd: Directory 'ccpp-2015-10-21-11:16:39-3987' creation detected
Oct 21 11:16:45 svr-h002607 abrtd: Generating core_backtrace
Oct 21 11:16:45 svr-h002607 abrtd: Duplicate: core backtrace
Oct 21 11:16:45 svr-h002607 abrtd: DUP_OF_DIR: /var/spool/abrt/ccpp-2015-10-21-09:20:11-24491
Oct 21 11:16:45 svr-h002607 abrtd: Deleting problem directory ccpp-2015-10-21-11:16:39-3987 (dup of ccpp-2015-10-21-09:20:11-24491)
Oct 21 11:16:46 svr-h002607 abrtd: Sending an email...
Oct 21 11:16:46 svr-h002607 abrtd: Email was sent to: root@localhost
I have tried re-installing, even using php-magickwand instead of php-pecl-imagick, but the same fault appears. Oh, I've also tried removing php-pecl-imagick and installing it from 'pecl install imagick'. While it installed fine, I still received the same error.
I'm kinda at my limit with troubleshooting it, so any suggestions would be very much appreciated.
Thank you,
Elliot