Page 1 of 1

/usr/bin/convert: line 23: 20816 Segmentation fault $NICE $PROGRAM "$@"

Posted: 2015-07-06T12:46:10-07:00
by liapop
Hi there,

When resizing large images I get the error message: /usr/bin/convert: line 23: 20816 Segmentation fault $NICE $PROGRAM "$@" . The resizing works just fine for not so large images.

Command sample: shell_exec("/usr/bin/convert -quality 100 -resize '446x300' '$image_url' '$image_url' 2>&1");

Any help would be appreciated.
Best wishes,
Lia.

Re: /usr/bin/convert: line 23: 20816 Segmentation fault $NICE $PROGRAM "$@"

Posted: 2015-07-06T13:36:43-07:00
by Bonzo
Some more info might help to get a useful reply:
IM version
What size are your large files
What format are the files

Re: /usr/bin/convert: line 23: 20816 Segmentation fault $NICE $PROGRAM "$@"

Posted: 2015-07-06T15:55:29-07:00
by fmw42
Try putting the input image right after convert for proper IM 6 syntax. Do you have permissions for read and write to the directory you have? Does your system allow shell_exec()? Have you tried just exec()? Are you getting the input image from http: or from your disk? I am not sure IM can write to http:. To get better information do the following:

Code: Select all

<?php
exec("/usr/bin/convert '$image_url' -resize '446x300' -quality 100  '$image_url' 2>&1",$out,$returnval); 
foreach($out as $text)
{echo "$text<br>";}
?>

Re: /usr/bin/convert: line 23: 20816 Segmentation fault $NICE $PROGRAM "$@"

Posted: 2015-07-06T21:59:28-07:00
by liapop
Hi there,

Thanks for your replies. Sorry for not providing more information. Image type is jpg. Image size is 6.55M (don't know exactly what's the image size limt for which my resizing command works). The website is hosted at Heart Internet so don't really know what's the IM installed version. Can you advise how this can be found out using PHP commands please?

@fmw24: I think the instruction is correct - as I was saying, it works for smaller images. I get the input image from the disk. I do have permissions. After running your code on a 9MB image I get: /usr/bin/convert: line 23: 5514 Segmentation fault $NICE $PROGRAM "$@".

Re: /usr/bin/convert: line 23: 20816 Segmentation fault $NICE $PROGRAM "$@"

Posted: 2015-07-06T23:36:40-07:00
by fmw42
Segmentation fault $NICE $PROGRAM "$@".
This does not seem to be a reasonable IM error? Where does it get $NICE $PROGRAM "$@"? There is no line 23 in my command line?

Perhaps there is an issue with your PHP configuration? Can you run my command line from a terminal without the exec(...)?

Re: /usr/bin/convert: line 23: 20816 Segmentation fault $NICE $PROGRAM "$@"

Posted: 2015-07-06T23:45:21-07:00
by liapop
Hi fmw42,

Your exec() command works just fine when trying to resize a 6MB image - the Segmentation fault error only shows when the exec command is being applied to larger images - so I'm thinking that it's related to some memory limits - don't have to much experience in working with IM so was hoping that someone here could help me.

Re: /usr/bin/convert: line 23: 20816 Segmentation fault $NICE $PROGRAM "$@"

Posted: 2015-07-07T00:17:21-07:00
by liapop
UPDATE - ImageMagick details

Version: ImageMagick 6.8.3-6 2013-03-15 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP Modules
Delegates: bzlib fontconfig freetype gslib jng jp2 jpeg lcms pango png ps rsvg tiff wmf x xml zlib

Re: /usr/bin/convert: line 23: 20816 Segmentation fault $NICE $PROGRAM "$@"

Posted: 2015-07-07T09:43:25-07:00
by fmw42
You Hosting service may have given you limited tmp space, which is getting filled for large images. Check with your hosting service.

Re: /usr/bin/convert: line 23: 20816 Segmentation fault $NICE $PROGRAM "$@"

Posted: 2015-07-07T22:22:21-07:00
by liapop
Hi, I have raised a ticket for my hosting - but they did not help me very much. Anyway, Google did. Adding -limit memory 64 -limit map 128 to the command line seems to fix the problem. Thanks all for your help!