php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61122 Imagick::newImage() results in segmentation fault on 64 bit machines
Submitted: 2012-02-17 14:09 UTC Modified: 2015-01-08 22:16 UTC
Votes:9
Avg. Score:3.8 ± 1.2
Reproduced:7 of 8 (87.5%)
Same Version:1 (14.3%)
Same OS:3 (42.9%)
From: andries at centim dot be Assigned: mkoppanen (profile)
Status: Wont fix Package: imagick (PECL)
PHP Version: 5.3.10 OS: *nix
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-02-17 14:09 UTC] andries at centim dot be
Description:
------------
Imagick::newImage() results in segmentation fault on 64 bit machines. The segfault only occurs on php-cli.

Details of my operating system, and relevant installed packages:

* Linux vgls66 2.6.34.10-0.6-xen #1 SMP x86_64 x86_64 x86_64 GNU/Linux
* Version: ImageMagick 6.6.1-0 2011-09-06 Q16 
* PECL extension: Imagick 3.0.1



Test script:
---------------
<?php

$img = new \Imagick();
$img->newImage(64, 96, new \ImagickPixel('black'));

// Segmentation fault

Expected result:
----------------
I'm expecting an Imagick object with the given dimensions, and a black background color.

Actual result:
--------------
Segmentation fault

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-02-17 14:13 UTC] andries at centim dot be
changed package from *Graphics related to imagick
 [2012-02-17 14:13 UTC] andries at centim dot be
-Package: *Graphics related +Package: imagick
 [2012-02-17 14:34 UTC] jpauli@php.net
Seems like a libmagickwand bug.
http://www.imagemagick.org/discourse-server/viewtopic.php?
f=3&t=14788&p=51772&hilit=openmp#p51772
 [2012-03-15 17:09 UTC] spam at ethaniel dot com
Limit Imagick to using only 1 thread.
Add this code before newImage:

$img->setResourceLimit(6, 1); // 6 means "limit threads to"
 [2013-12-03 11:31 UTC] mike@php.net
-Assigned To: +Assigned To: mkoppanen
 [2015-01-05 03:30 UTC] danack@php.net
-Status: Assigned +Status: Feedback
 [2015-01-05 03:30 UTC] danack@php.net
This is very likely to be an OpenMP related issue. Please set the thread limit to one, or recompile ImageMagick to not use OpenMP.
 [2015-01-05 09:21 UTC] andries at centim dot be
-Status: Feedback +Status: Assigned
 [2015-01-05 09:21 UTC] andries at centim dot be
Limit Imagick to using only 1 thread resolves the issue.
 [2015-01-08 22:16 UTC] danack@php.net
-Status: Assigned +Status: Wont fix
 [2015-01-08 22:16 UTC] danack@php.net
As this is a bug in the underlying libraries, there is unfortunately nothing for us to fix here.

I'm going to add a bigger note about the thread setting to the next release of Imagick.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 06:01:26 2019 UTC