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

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
liapop
Posts: 5
Joined: 2015-07-06T12:41:11-07:00
Authentication code: 1151

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

Post 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.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

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

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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>";}
?>
liapop
Posts: 5
Joined: 2015-07-06T12:41:11-07:00
Authentication code: 1151

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

Post 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 "$@".
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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(...)?
liapop
Posts: 5
Joined: 2015-07-06T12:41:11-07:00
Authentication code: 1151

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

Post 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.
liapop
Posts: 5
Joined: 2015-07-06T12:41:11-07:00
Authentication code: 1151

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

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

You Hosting service may have given you limited tmp space, which is getting filled for large images. Check with your hosting service.
liapop
Posts: 5
Joined: 2015-07-06T12:41:11-07:00
Authentication code: 1151

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

Post 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!
Post Reply