php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56423 imagick_readimage() Segfaults when file is not found
Submitted: 2005-06-22 20:09 UTC Modified: 2007-04-10 19:25 UTC
From: geeteq at hotmail dot com Assigned:
Status: Closed Package: imagick (PECL)
PHP Version: 4.3.10 OS: Linux orange 2.6.11.10-GROOVECOD
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: geeteq at hotmail dot com
New email:
PHP Version: OS:

 

 [2005-06-22 20:09 UTC] geeteq at hotmail dot com
Description:
------------
Imagick Version 0.9.11
PHP Version 4.3.11
ImageMagick Verion: 6.2.2.3-r1

When running imagick_readimage() and the file doesn't 
exist the current process exits with a segmentation 
fault

The php script execution returns nothing at all and the 
web server error log displays the following:

error_log:[Wed Jun 22 01:08:30 2005] [notice] child pid 
10438 exit signal Segmentation fault (11)

currently i need to do something like

if (file_exists($image)) {
   $handle = imagick_readimage( $image );
}



Reproduce code:
---------------
        $handle = imagick_readimage( $image ) ;
        if ( imagick_iserror( $handle ) )
        {
                $reason      = imagick_failedreason( $handle ) ;
                $description = imagick_faileddescription( $handle ) ;

                print "handle failed!<BR>\nReason: $reason<BR>\nDescription: $description<BR>\n" ;
                exit ;
        }


Expected result:
----------------
no segfault.... normal script completion

Actual result:
--------------
(gdb) run -X -k start -D PHP4 -D SSL -D DOC
Starting program: /usr/sbin/apache2 -X -k start -D PHP4 
-D SSL -D DOC
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 19402)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 19402)]
0xb78a1ea2 in _efree () from /usr/lib/apache2/
extramodules/libphp4.so
(gdb) bt
#0  0xb78a1ea2 in _efree () from /usr/lib/apache2/
extramodules/libphp4.so
#1  0xb64b4390 in ListMagicInfo () from /usr/lib/
libMagick.so.6
#2  0xb6bbf39a in xsltSetGenericErrorFunc () from /usr/
lib/libxslt.so.1
(gdb) 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-10 19:25 UTC] scott at macvicar dot 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.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun May 11 20:01:28 2025 UTC