php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57995 apache2: Segmentation fault
Submitted: 2008-01-08 08:25 UTC Modified: 2008-01-11 07:07 UTC
From: andy at diginights dot com Assigned:
Status: Closed Package: imagick (PECL)
PHP Version: 5.2.1 OS: Debian 64-bit
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: andy at diginights dot com
New email:
PHP Version: OS:

 

 [2008-01-08 08:25 UTC] andy at diginights dot com
Description:
------------
Hi there,

We got problems executing some imagick php script:
Running the attached php script works with the php-cli, running it through apache doesn't work.
The apache worker quits with an "apache2: Memory allocation failed `Cannot allocate memory'" error.

Machine is a Debian 64 bit system, running kernel 2.6.22-3-amd64.
apache2.2.6-2
php-5.2.4-2
Server has a total amount of 8GB ram and its sure that there is enough memory left

Thank you

Reproduce code:
---------------
<?
$img = new Imagick('test.jpg');

// remove exif information to save a few bytes

$img->profileImage("*", null);
$img->writeImage('test2.jpg');
?>


Expected result:
----------------
script should generate an "test2.jpg" image without exif information

Actual result:
--------------
With the php-cli everything works, running through apache, apache is exiting with apache2: Memory allocation failed `Cannot allocate memory'

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-08 09:06 UTC] mkoppanen@php.net
I can reproduce this. I will investigate the issue further.
 [2008-01-08 10:23 UTC] mkoppanen@php.net
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.


 [2008-01-08 12:01 UTC] andy at diginights dot com
Hi again,

Thanks you very much for your quick reaction!

i checked out the new cvs version, compilied and installed it.
Apache is now exiting with a segmentation fault instead of quitting with the "not enough memory" message :(

Should this code work now?
 [2008-01-08 12:35 UTC] mkoppanen@php.net
Tested in 2.6.22-amd64 machine with apache 2.2.4 and php 5.2.3.

The CVS version works for me. Did you restart apache after reinstalling Imagick?
 [2008-01-08 19:17 UTC] andy at diginights dot com
Yes, apache was restarted after new imagick.so was included.

Its now exiting with Segmentation fault instead of Out of memory error.

[Wed Jan 09 01:17:01 2008] [notice] child pid 30854 exit signal Segmentation fault (11)

php-cli is still working.

Is it normal that this imagick version shows up in phpinfo with module version 2.1.0-rc2 and release date 12/24/07?

Can i do anything else to help?
 [2008-01-08 19:33 UTC] andy at diginights dot com
ah sorry, seems like i was hasty with this.

Its working now, but apache quits with a segfault when the output file exists and apache is not allowed to write at it because of file permissions.
 [2008-01-10 08:56 UTC] mkoppanen@php.net
The segmentation fault seems to be coming from ImageMagick. I will report this bug to them.
 [2008-01-10 09:14 UTC] mkoppanen@php.net
Can you please test with the latest CVS version?
 [2008-01-10 09:35 UTC] andy at diginights dot com
perfect, now it looks all fine:

Fatal error: Uncaught exception 'ImagickException' with message 'Unable to write file: test2.jpg. Permission denied' in ....

an no child dies.

Thank you for the very quick reaction!
 [2008-01-10 12:08 UTC] andy at diginights dot com
sorry for reopening.
With the new code its not possible to write any image...

there is always the "Permission denied" error event if the user permissions are correct!

Can you reproduce this?
 [2008-01-10 12:50 UTC] scottmac@php.net
Can you try another CVS checkout, I made changes to deal with threaded checks not working correctly.
 [2008-01-10 14:19 UTC] andy at diginights dot com
tried new version now, still "Permission denied", sorry!
 [2008-01-10 14:23 UTC] mkoppanen@php.net
Are you 100% sure that permission isn't actually denied? I tested this on 64bit linux and it works fine.

Try writing the image to for example /tmp/.
 [2008-01-10 14:30 UTC] andy at diginights dot com
permission is 100% correct, even chmod 777 on the directory doesn't work, file could not be written.
with 755 (apache is the owner) on the dir an Revision 1.248 of imagick.so it works fine and the pic is created
 [2008-01-11 07:07 UTC] mkoppanen@php.net
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.

Please test CVS version.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 22 04:01:28 2024 UTC