php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59692 Imagick::cropImage segfault
Submitted: 2011-03-27 17:07 UTC Modified: 2011-05-06 07:12 UTC
From: davidjmemmett at gmail dot com Assigned:
Status: Closed Package: imagick (PECL)
PHP Version: 5.3.3 OS: Ubuntu 10.10
Private report: No CVE-ID: None
 [2011-03-27 17:07 UTC] davidjmemmett at gmail dot com
Description:
------------
Calls to Imagick::cropImage fail. I've tried the OS-shipped 
imagick.so and I've 
also installed it via pecl (after uninstalling the OS-shipped 
one).

Reproduce code:
---------------
<?php

$image = new Imagick('mario-1-1.gif');
$image->cropImage(8,8,0,0);

Expected result:
----------------
I expect no segmentation fault.

Actual result:
--------------
david@icecap:~/mario-images$ gdb php
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and 
redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type 
"show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/php...Reading symbols from 
/usr/lib/debug/usr/bin/php5...done.
done.
(gdb) run test.php 
Starting program: /usr/bin/php test.php
[Thread debugging using libthread_db enabled]
[New Thread 0xb7d6eb70 (LWP 3597)]
[Thread 0xb7d6eb70 (LWP 3597) exited]
[New Thread 0xb7d6eb70 (LWP 3598)]
[New Thread 0xb6e32b70 (LWP 3599)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb6e32b70 (LWP 3599)]
0x0144e8da in ?? ()
(gdb) run test.php 
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/bin/php test.php
[Thread debugging using libthread_db enabled]
[New Thread 0xb7d6eb70 (LWP 4252)]
[Thread 0xb7d6eb70 (LWP 4252) exited]
[New Thread 0xb7d6eb70 (LWP 4253)]
[New Thread 0xb6e32b70 (LWP 4254)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb6e32b70 (LWP 4254)]
0x0144e8dd in do_wait (bar=0x89f15f0, state=4)
    at ../../../src/libgomp/config/linux/wait.h:53
53	../../../src/libgomp/config/linux/wait.h: No such 
file or directory.
	in ../../../src/libgomp/config/linux/wait.h

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-18 20:32 UTC] euskadi31 at gmail dot com
I have the same problem on my gentoo


<?php

$image = new Imagick('test.jpg');
$image->cropImage(8,8,0,0);// == segfault
$image->cropThumbnailImage(8, 8); // == segfault
$image->thumbnailImage(8,8);// == segfault



PHP 5.2.17-pl0-gentoo (cli) (built: Jan 20 2011 19:59:18) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend 
Technologies
 [2011-05-06 07:12 UTC] mkoppanen@php.net
Hi,

this is an issue with ImageMagick and OpenMP. Compile imagemagick without openmp and the error should go away.
 [2012-02-14 20:53 UTC] spam at ethaniel dot com
This problem can be solved by setting an environment variable 
MAGICK_THREAD_LIMIT=1

like: env MAGICK_THREAD_LIMIT=1 php test.php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 00:01:27 2024 UTC