php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36258 Iterator method getPath crashes Apache
Submitted: 2006-02-02 12:43 UTC Modified: 2006-02-02 13:20 UTC
From: michael202 at gmx dot de Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 5CVS-2006-02-02 (snap) OS: Linux
Private report: No CVE-ID: None
 [2006-02-02 12:43 UTC] michael202 at gmx dot de
Description:
------------
when iterating through a dir structure the apache process serving this script crashes with 'child pid XY exit signal Segmentation fault (11)' when trying to execute getPath method

Reproduce code:
---------------
  function test_apache_segfault()
  {
    $diriter = new RecursiveIteratorIterator( new RecursiveDirectoryIterator('.') );

    foreach ($diriter as $key => $file) {
      echo($file->getFilename()); flush(); 
      echo(' 1'); flush();

     // 'child pid XY exit signal Segmentation fault (11)'
     echo($file->getPath()); // <-- crash here      
     echo(' 2'); flush();
    }  // foreach
   echo(' end'); flush();
  }


Expected result:
----------------
a list of more than one entry and
the word 'end' at the end

Actual result:
--------------
output ends after the 'echo 1'

when commenting out the line with 'getPath' this function runs till the end.

checked this with 
- apache 2.0.53 and php 5.0.4  both compiled by myself
- apache 2.2.0 and php 5.1.2  both compiled by myself
- apache 2.2.0 and php 5.1.3-dev (2006-02-02 snap)  both compiled by myself

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-02 13:20 UTC] tony2001@php.net
This bug has been fixed in CVS.

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/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 09:01:30 2024 UTC