#36287 [Fbk->Asn]: segfault with RecursiveIteratorIterator
| From: | helly@php.net | Date: | Sun, 05 Feb 2006 11:33:51 +0000 |
| Subject: | #36287 [Fbk->Asn]: segfault with RecursiveIteratorIterator | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-92926@lists.php.net to get a copy of this message | ||
ID: 36287
Updated by: helly@php.net
Reported By: meeb at meeb dot org
-Status: Feedback
+Status: Assigned
Bug Type: Filesystem function related
-Operating System: Debian64 EMT64 SMP
+Operating System: *
PHP Version: 5.1.2
-Assigned To:
+Assigned To: helly
Previous Comments:
------------------------------------------------------------------------
[2006-02-04 18:44:42] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.1-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.1-win32-latest.zip
------------------------------------------------------------------------
[2006-02-04 17:45:06] meeb at meeb dot org
s/iterator/object/
whoops :p
------------------------------------------------------------------------
[2006-02-04 17:42:12] meeb at meeb dot org
Description:
------------
When accidently comparing a the iterator created by
RecursiveDirectoryIterator against a string PHP segfaulted. This is new
to 5.1.2 (worked under 5.1.1 and I was unaware of the issue with my
code). There are obvious workarounds for this so no major panic.
Removing the 'if':
if($file!="."&&$file!="..")
stops the segfault.
Unfortunately I only have EMT64/Debian64 servers available so I am
unable to test this for cross-platform compatibility, and I was unable
to find any exact matching bugs (closest were a few stack
corruptions).
This occurs when the script is executed on the command line and via
apache2. I have saved straces should they be requested.
Reproduce code:
---------------
$this->dir = new RecursiveIteratorIterator(new
RecursiveDirectoryIterator("."),true);
foreach($this->dir as $file){
// works...
echo $file->getPathName()."\n";
// segfauls...
if($file!="."&&$file!="..") echo
$file->getPathName()."\n";
}
Expected result:
----------------
./dir/
./dir/file1.ext
./dir/file2.ext
....
Actual result:
--------------
Segmentation Fault.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36287&edit=1