php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57738 Imagick::readImage() fails with larger files
Submitted: 2007-07-11 05:22 UTC Modified: 2007-07-11 10:53 UTC
From: tony at sekl dot co dot uk Assigned:
Status: Not a bug Package: imagick (PECL)
PHP Version: 5.2.1 OS: Linux RHEL
Private report: No CVE-ID: None
 [2007-07-11 05:22 UTC] tony at sekl dot co dot uk
Description:
------------
Imagick version: 2.0.0-beta2
ImageMagick version: 6.3.5 07/09/07 Q16

When I try to read a file using readImage() I get a blank response and the following error in the apache log:
[Wed Jul 11 09:07:42 2007] [notice] child pid 24324 exit signal Segmentation fault (11)

It only seems to happen when using files larger than about 100Kb

Reproduce code:
---------------
$img = new Imagick();
$img->readImage('1407.jpg');
echo("Hello");

Expected result:
----------------
"Hello" output to browser.

Actual result:
--------------
200 OK Response with no body. And this error in apache log:
[Wed Jul 11 09:07:42 2007] [notice] child pid 24324 exit signal Segmentation fault (11)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-11 06:51 UTC] tony at sekl dot co dot uk
Not a bug. Sorry.

Was passing a file with no extension.

Sorry for wasting your time.
 [2007-07-11 06:54 UTC] mkoppanen@php.net
It should not segfault anyway. I am unable to reproduce the segfault with exactly the same versions.
 [2007-07-11 07:38 UTC] tony at sekl dot co dot uk
I think it is a problem with my ImageMagick compilation:

$ convert -size 500x500 'phpHhTeR2.jpg' -thumbnail '500x500>' 'xyz.jpg'
Segmentation fault
Here is the image: http://89.234.7.89/images/phpHhTeR2.jpg

Here is the stack trace:

$ gdb convert
GNU gdb Red Hat Linux (6.3.0.0-1.143.el4rh)
Copyright 2004 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 "i386-redhat-linux-gnu"...
(no debugging symbols found)
Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) run -size 500x500 'phpHhTeR2.jpg' -thumbnail '500x500>' 'zyx.jpg'
Starting program: /usr/bin/convert -size 500x500 'phpHhTeR2.jpg' -thumbnail '500x500>' 'zyx.jpg'
[Thread debugging using libthread_db enabled]
[New Thread -1208879424 (LWP 28463)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208879424 (LWP 28463)]
0x007e1d1a in realloc () from /lib/tls/libc.so.6
(gdb)
 [2007-07-11 10:53 UTC] tony at sekl dot co dot uk
FYI: I submitted this to the ImageMagick guys who have replicated that problem and have a fix for the next release.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Aug 14 21:01:24 2020 UTC