ID: 12141
Updated by: thies
Old Status: Open
Status: Closed
Bug Type: Reproducible crash
Operating System: RedHat Linux 7.1 (Intel)
PHP Version: 4.0.6
New Comment:

fixed in CVS

Previous Comments:

[2001-07-13 09:08:26] [EMAIL PROTECTED]

I have one PCD (Kodak PhotoCD) file which crashes PHP when I run iptcparse on its 

The error message is "FATAL:  emalloc():  Unable to allocate -4095 bytes".

Unfortunately, I wasn't able to produce a core file (probably too dumb to configure 
with --enable-debug). PHP was configured "plain" (just "./configure", "make", "make 

I can reproduce this crash with PHP 4.0.2-dev and 3.0.13-dev (error message here: 
"FATAL:  emalloc():  Unable to allocate 4294963201 bytes") under Solaris, and with an 
older PHP 4 under RedHat Linux 6.2.

Hundreds of other PCD files work fine, some of them bigger than my example file.

You can download this PCD file from (it's nearly 5 

This is how you can reproduce the crash:
[tim@dhcp5 tim]$ ll
insgesamt 7896
-rw-rw-r--    1 tim      tim       4898816 Jun 22 11:48 crash.pcd
-rw-rw-r--    1 tim      tim           510 Jun 22 12:06 iptcparse-crash.php
[tim@dhcp5 tim]$ cat iptcparse-crash.php

if (! isset($argv[ 1 ]))
  { echo "Usage: php iptcparse-crash.php <filename>\n";

$filename = $argv[ 1 ];

$buffer = "";


if (isset($info[ "APP13" ]))
  $buffer = $info[ "APP13" ];
  { $fp = fopen($filename,"r");
        if ($fp)
          { $buffer = fread($fp,filesize($filename));

$ok = 0;

if ($buffer != "")
  { echo "before iptcparse() ...\n";
        $iptc = iptcparse($buffer);
        echo "... after iptcparse()\n";

[tim@dhcp5 tim]$ php -v
[tim@dhcp5 tim]$ php -q iptcparse-crash.php crash.pcd
before iptcparse() ...
FATAL:  emalloc():  Unable to allocate -4095 bytes


Edit this bug report at

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to