php.net |  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
 [2004-10-29 18:01 UTC] kevin at oceania dot net
Description:
------------
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:
---------------
<?php

  error_reporting(E_ALL);

  $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.
(gdb)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-30 18:58 UTC] helly@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: Sat Dec 21 14:01:32 2024 UTC