#36287 [Opn]: segfault with RecursiveIteratorIterator
ID: 36287 User updated by: meeb at meeb dot org Reported By: meeb at meeb dot org Status: Open Bug Type: Filesystem function related Operating System: Debian64 EMT64 SMP PHP Version: 5.1.2 New Comment: s/iterator/object/ whoops :p Previous Comments: [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
#36287 [NEW]: segfault with RecursiveIteratorIterator
From: meeb at meeb dot org Operating system: Debian64 EMT64 SMP PHP version: 5.1.2 PHP Bug Type: Filesystem function related Bug description: segfault with RecursiveIteratorIterator 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 bug report at http://bugs.php.net/?id=36287&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36287&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36287&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36287&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36287&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36287&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36287&r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=36287&r=needscript Try newer version:http://bugs.php.net/fix.php?id=36287&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36287&r=support Expected behavior:http://bugs.php.net/fix.php?id=36287&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36287&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36287&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36287&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36287&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36287&r=dst IIS Stability:http://bugs.php.net/fix.php?id=36287&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36287&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36287&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36287&r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=36287&r=mysqlcfg