From:             cpriest at warpmail dot net
Operating system: Apache 2.0.55
PHP version:      5.2.0
PHP Bug Type:     Reproducible crash
Bug description:  opendir - Segmentation Fault - Reproducable

Description:
------------
I am getting segmentation faults while using opendir().  This has been
going off and on with glob() and opendir() over the course of many
versions.  

I've never really thought it was with php but the segmentation faults only
occur while using nearly any of the directory based functions in php from
versions 5.0.x through 5.2.x


Reproduce code:
---------------
                                        function LocateImportFiles($Path) {
                                                $tFilepaths = array();
                                                if(($hDir = opendir($Path)) !== 
false) {
                                                        while(($filepath = 
readdir($hDir)) !== false) {
                                                                echo 
$filepath.'<BR>';  flush();
                                                                
if(is_dir($filepath))
                                                                        
$tFilepaths = array_merge($tFilepaths,
LocateImportFiles($filepath));
                                                                else {
                                                                        
switch(array_pop(explode('.',$filepath))) {
                                                                                
case 'htm':
                                                                                
case 'html':
                                                                                
        $tFilepaths[$filepath] = 'Html Creative';
                                                                                
        break;
                                                                                
case 'txt':
                                                                                
        if(strstr($filepath, 'Subjects') !== false)
                                                                                
                $tFilepaths[$filepath] = 'Subject Lines';
                                                                                
        else
                                                                                
                $tFilepaths[$filepath] = 'Unknown (Ignore)';
                                                                                
        break;
                                                                                
case 'zip':
                                                                                
        UnzipFile($filepath, dirname($filepath), $OutputDir, false);
                                                                                
        $tFilepaths = array_merge($tFilepaths,
LocateImportFiles($OutputDir));
                                                                                
        break;
                                                                        }
                                                                }
                                                        }
                                                        closedir($hDir);
                                                }
                                                return $tFilepaths;
                                        }


Expected result:
----------------
no crashes

Actual result:
--------------
segmentation fault.

Is there any way I can glean any usable information from the segmentation
fault I can send you?  Invariably this type of problem never seems to be
able to be reproduced elsewhere and perhaps I can get you a dump of some
file to isolate where the issue is?

-- 
Edit bug report at http://bugs.php.net/?id=39717&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=39717&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=39717&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=39717&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=39717&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=39717&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=39717&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=39717&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=39717&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=39717&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=39717&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=39717&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=39717&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=39717&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=39717&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=39717&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=39717&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=39717&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=39717&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=39717&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=39717&r=mysqlcfg

Reply via email to