php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58405 PHP crashes on Image::readImageFile
Submitted: 2008-11-03 15:32 UTC Modified: 2008-11-04 14:01 UTC
From: marc dot bennewitz at giata dot de Assigned:
Status: Closed Package: imagick (PECL)
PHP Version: 5.2.6 OS: Linux (SuSE 10.1 32Bit)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: marc dot bennewitz at giata dot de
New email:
PHP Version: OS:

 

 [2008-11-03 15:32 UTC] marc dot bennewitz at giata dot de
Description:
------------
On calling Imagick::readImageFile php crashes

(Can't select PHP-Version 5.2.6)

Reproduce code:
---------------
error_reporting(E_ALL); ini_set('display_errors', 'On');
$fp = fopen('./test.jpg', 'rb');
$imagick = new Imagick();
$imagick->readImageFile($fp);
var_dump($imagick);
fclose($fp);

Expected result:
----------------
The var_dump - info of the imagick object

Actual result:
--------------
PHP crashes without any output and must kill

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-03 15:42 UTC] mkoppanen@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

Can not reproduce here. Can you generate a backtrace using the following instructions: http://bugs.php.net/bugs-generating-backtrace.php

Can you also post your ImageMagick version?
 [2008-11-03 18:25 UTC] marc dot bennewitz at giata dot de
ImageMagick: 6.2.5
PHP-Configure:
./configure \
  --enable-debug \
  --with-apxs2=/usr/local/apache2/bin/apxs \
  --with-mysqli=shared,/usr/local/mysql/bin/mysql_config \
  --with-mysql=shared,/usr/local/mysql \
  --with-sqlite=shared \
  --enable-pdo=shared \
  --with-pdo-mysql=shared,/usr/local/mysql \
  --with-pdo-sqlite=shared \
  --enable-soap \
  --with-zlib \
  --enable-zip \
  --disable-cgi \
  --with-libxml-dir=/usr/local/lib \
  --with-xsl \
  --with-mcrypt \
  --with-openssl \
  --enable-mbstring \
  --enable-mbregex \
  --with-gd=shared \
  --with-freetype-dir= \
  --with-jpeg-dir=/usr/lib \
  --enable-gd-native-ttf \
  --enable-ftp=shared \

Debug:
# ulimit -c unlimited
# gdb php
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-suse-linux"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) run test_imagick_readImageFile.php
Starting program: /usr/local/bin/php test_imagick_readImageFile.php
[Thread debugging using libthread_db enabled]
[New Thread -1213039968 (LWP 28654)]
Error while reading shared library symbols:
Cannot find new threads: generic error


Program received signal SIGINT, Interrupt.
[Switching to Thread -1213039968 (LWP 28654)]
0xb7fe4822 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
(gdb) bt
#0  0xb7fe4822 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0xb7bd6753 in __read_nocancel () from /lib/libc.so.6
#2  0xb7b87a98 in _IO_file_read_internal () from /lib/libc.so.6
#3  0xb7b874da in _IO_file_xsgetn_internal () from /lib/libc.so.6
#4  0xb7b894a8 in _IO_sgetn_internal () from /lib/libc.so.6
#5  0xb7b7db71 in fread () from /lib/libc.so.6
#6  0xb738ac85 in ImageToFile () from /usr/lib/libMagick.so.9
#7  0xb7443cab in SetImageInfo () from /usr/lib/libMagick.so.9
#8  0xb73bb21e in ReadImage () from /usr/lib/libMagick.so.9
#9  0xb759b507 in MagickReadImageFile () from /usr/lib/libWand.so.9
#10 0xb75e28f8 in zim_imagick_readimagefile (ht=1, return_value=0xb7af4824, return_value_ptr=0x0, this_ptr=0xb7af47e8, return_value_used=0)
    at /mben/sources/imagick-2.2.1/imagick_class.c:1838
#11 0x08353fd0 in zend_do_fcall_common_helper_SPEC (execute_data=0xbfffafb4) at /mben/sources/php-5.2.6/Zend/zend_vm_execute.h:200
#12 0x08354c1d in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=0xbfffafb4) at /mben/sources/php-5.2.6/Zend/zend_vm_execute.h:322
#13 0x08353b31 in execute (op_array=0xb7af3f10) at /mben/sources/php-5.2.6/Zend/zend_vm_execute.h:92
#14 0x0832e9a3 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /mben/sources/php-5.2.6/Zend/zend.c:1134
#15 0x082dc414 in php_execute_script (primary_file=0xbfffd358) at /mben/sources/php-5.2.6/main/main.c:2005
#16 0x083ab952 in main (argc=2, argv=0xbfffd4a4) at /mben/sources/php-5.2.6/sapi/cli/php_cli.c:1140
 [2008-11-03 18:28 UTC] marc dot bennewitz at giata dot de
The program didn't end in Segmantaion fault but it didn't stop.
 [2008-11-03 18:49 UTC] mkoppanen@php.net
Can you test with newer ImageMagick? The version you got is really, really old and I suspect this is an ImageMagick bug.
 [2008-11-04 14:01 UTC] marc dot bennewitz at giata dot de
Now I have compiled ImageMagick 6.4.2-6 and it works.

Is it a good idea to change the required ImageMagick version up ?

Thanks for you help :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 02:01:28 2024 UTC