|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56222 Memory Leak
Submitted: 2004-10-29 18:01 UTC Modified: 2004-10-30 18:58 UTC
From: kevin at oceania dot net Assigned: helly (profile)
Status: Closed Package: PECL bug system (PECL)
PHP Version: 5.0.2 OS: *
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.
Bug Type:
From: kevin at oceania dot net
New email:
PHP Version: OS:


 [2004-10-29 18:01 UTC] kevin at oceania dot net
I have had mixed results from this. Sometimes just crashing, sometimes dumping rubbish to the browser, or memory leak errors
/home/kevin/html/php/dev/this/php5-200410111830/main/spprintf.c(707) :  Freeing 0x09E2237C (79 bytes), script=/home/kevin/html/blah.php
=== Total 1 memory leaks detected ===
/home/kevin/html/blah.php(15) : Fatal error - Allowed memory size of 8388608 bytes exhausted at /home/kevin/html/php/dev/this/php5-200410111830/ext/spl/spl_directory.c:303 (tried to allocate 1851878463 bytes)
Allowed memory size of 8388608 bytes exhausted at /home/kevin/html/php/dev/this/php5-200410111830/Zend/zend_stack.c:28 (tried to allocate 256 bytes)

Reproduce code:


  $path = './';

  $offset = 3;

  $count = 5;

  $obj= new LimitIterator(new DirectoryIterator($path), $offset, $count);
  foreach($obj as $key=>$file)
    echo $obj->current(). ' -> ';
    echo $obj->getPathname() . '<br />';

Expected result:
Expect  to get current filename and path

Actual result:
(gdb) run -X
Starting program: /usr/local/apache/bin/httpd -X
[Thread debugging using libthread_db enabled]
[New Thread -1084544960 (LWP 20216)]

Program exited with code 01.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-30 18:58 UTC]
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
In case this was a documentation problem, the fix will show up soon at

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

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Jan 28 01:03:46 2023 UTC