#34415 [Opn->Fbk]: seg fault when using scandir

From: Date: Wed, 07 Sep 2005 21:43:43 +0000
Subject: #34415 [Opn->Fbk]: seg fault when using scandir
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-84655@lists.php.net to get a copy of this message
ID: 34415 Updated by: sniper@php.net Reported By: worthbob01 at yahoo dot com -Status: Open +Status: Feedback Bug Type: Reproducible crash Operating System: rh es 3 PHP Version: 5.1.0RC1 New Comment: Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip Previous Comments: ------------------------------------------------------------------------ [2005-09-07 23:13:41] worthbob01 at yahoo dot com Description: ------------ recursive scandir causes seg fault. code example from http://us2.php.net/scandir User Contributed Notes. Reproduce code: --------------- <?php $afiles = scandir_recursive("/tmp"); function scandir_recursive($directory) { $folderContents = array(); $directory = realpath($directory).DIRECTORY_SEPARATOR; foreach (scandir($directory) as $folderItem) { if ($folderItem != "." AND $folderItem != "..") { if (is_dir($directory.$folderItem.DIRECTORY_SEPARATOR)) { $folderContents[$folderItem] = scandir_recursive( $directory.$folderItem."\\"); } else { $folderContents[] = $folderItem; } } } return $folderContents; } ?> Expected result: ---------------- nothing as there is not output in the sample. just expected it to run without a seg fault. Actual result: -------------- [bob@dev design]# date;php sample.php;date Wed Sep 7 16:11:11 CDT 2005 Segmentation fault Wed Sep 7 16:11:12 CDT 2005 [bob@dev design]# ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34415&edit=1

« previous php.bugs (#84655) next »