php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25127 error with memory limit
Submitted: 2003-08-18 08:44 UTC Modified: 2003-08-22 15:02 UTC
Votes:6
Avg. Score:4.7 ± 0.7
Reproduced:5 of 5 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: henrik dot gebauer at web dot de Assigned: iliaa (profile)
Status: Closed Package: GD related
PHP Version: 4.3.3RC5-dev, 5.0.0b2-dev OS: Mandrake 9.1
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: henrik dot gebauer at web dot de
New email:
PHP Version: OS:

 

 [2003-08-18 08:44 UTC] henrik dot gebauer at web dot de
Description:
------------
Fatal error:  Allowed memory size of 8388608 bytes exhausted at (null):0 (tried to allocate 7936 bytes) in /mnt/win_e/hosts/tests/gallery-creator/step2.php on line 67

The line contains and imagecreatefromjpeg() call.

With reloading the script, the allowed memory size appears to grow. After the 5th reload I get the error:

Fatal error:  Allowed memory size of 18901728 bytes exhausted at (null):0 (tried to allocate 7936 bytes) in /mnt/win_e/hosts/tests/gallery-creator/step2.php on line 67

I compiled PHP as a module for Apache 2 with --enable-memory-limit

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

$image = imagecreatefromjpeg('image.jpeg');
echo 'success';

?>

Expected result:
----------------
success

Actual result:
--------------
Fatal error:  Allowed memory size of 8388608 bytes exhausted at (null):0 (tried to allocate 7936 bytes) in /mnt/win_e/hosts/tests/gallery-creator/step2.php on line 67

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-19 06:25 UTC] henrik dot gebauer at web dot de
My configure line:

'./configure' \
'--with-apxs2=/usr/local/apache2/bin/apxs' \
'--with-config-file-path=/etc' \
'--with-zlib' \
'--with-gd' \
'--with-mysql=/usr/src/mysql-4.0.14/include/' \
'--enable-sockets' \
'--enable-memory-limit' \
'--enable-trans-sid' \
'--with-jpeg-dir=/usr/src/jpeg-6b' \
'--with-png-dir=/usr/src/libpng'

The error does not occur with images with a smaller file size.

Try this picture to reproduce it:
http://www.henrikgebauer.de.vu/bilder/klassenfahrt_kanu2003/p1010025.jpg
 [2003-08-19 07:06 UTC] sniper@php.net
[jani@rh62 jani]$ php -dmemory_limit=9388608 -r 'imagecreatefromjpeg("p1010025.jpg");'

Fatal error: Allowed memory size of 9388608 bytes exhausted (tried to allocate 7936 bytes) in Command line code on line 1
/usr/src/web/php/php4_3/main/streams.c(392) : Stream of type 'STDIO' 0x085CAF2C (path:p1010025.jpg) was not closed

 [2003-08-22 15:02 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 09:01:28 2024 UTC