Iterator method getPath crashes Apache
[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