apache2.2: convert: Memory allocation failed

Michael Ablassmeier abi at grinser.de
Mon Oct 23 21:20:20 UTC 2006


hi,

im running apache-2.2.0_7 on 6.1-RELEASE within a jailed environment. PHP4 has
been compiled without Suhosin patch and its pretty much all in default
configuration, so no restrictions.

Now, the Problem: running gallery, which calls various ImageMagick binaries in
order to resize Images, fails with the following Error message in
httpd-error.log:

      [..]
	convert in free(): warning: junk pointer, too high to make sense
	convert in free(): warning: junk pointer, too high to make sense
	convert in free(): warning: junk pointer, too high to make sense
	convert: Memory allocation failed `Permission denied'.
      [..]

a hackish PHP script in order to reproduce this failure (note, the image size
has to be bigger than 150x150):

 <?
  system("convert -size 150x150 -quality 50 -thumbnail 150x150 1.jpg 2.jpg");
 ?>

now, this script does *not* fail if im calling it from php's cli interface
(with the same php.ini used). I can also easily convert the image calling
convert from some random shell. The interesting part is, i dont have to convert
something in order to reproduce this error, i can simply replace the above
convert call with

 <?
  system("convert -list resource"); [0]
 ?> 

in order to make it bail out. Any Ideas? I've been using apache2.0.x before and
never had any problems running Gallery at all (before upgrading to 6.1-RELEASE
and apache2.2). 


[0] abi at foo:~/public_html/conv> convert -list resource
    File       Area     Memory        Map       Disk
    ------------------------------------------------
    3.96875kb      488mb      366mb  1.90625gb        4eb

bye,
    - michael


More information about the freebsd-apache mailing list