#42364 [Opn->Csd]: Crash when using getRealPath with DirectoryIterator
| From: | johannes@php.net | Date: | Tue, 21 Aug 2007 22:47:26 +0000 |
| Subject: | #42364 [Opn->Csd]: Crash when using getRealPath with DirectoryIterator | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-116435@lists.php.net to get a copy of this message | ||
ID: 42364
Updated by: johannes@php.net
Reported By: kfou at free dot fr
-Status: Open
+Status: Closed
Bug Type: Reproducible crash
Operating System: Windows and Linux
PHP Version: 5.2.4RC3-dev
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2007-08-21 19:02:21] kfou at free dot fr
Same problem using last win32 build:
$ php --version
PHP 5.2.4RC3-dev (cli) (built: Aug 21 2007 12:04:26)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
$ gdb --quiet php(gdb) run test.php
Starting program: c:\php/php.exe test.php
Program received signal SIGSEGV, Segmentation fault.
0x100ddc90 in ?? ()
------------------------------------------------------------------------
[2007-08-21 17:18:34] johannes@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.2-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.2-win32-installer-latest.msi
------------------------------------------------------------------------
[2007-08-21 17:15:50] kfou at free dot fr
Description:
------------
Calling getRealPath on an DirectoryIterator make PHP crash,
getPath works fine.
The problem also happens with php 5.2.3
Reproduce code:
---------------
<?php
$it = new DirectoryIterator("/tmp");
foreach ($it as $e)
{
$path = $e->getRealPath();
}
?>
Actual result:
--------------
(gdb) run test.php
Starting program: /home/wwwdev/php/bin/php test.php
Failed to read a valid object file image from memory.
Program received signal SIGSEGV, Segmentation fault.
tsrm_realpath (path=0x0, real_path=0xbfb0f20c "6É\025\b\001")
at /home/wwwdev/php5.2-200708201630/TSRM/tsrm_virtual_cwd.c:1266
1266 if (!*path) {
(gdb) bt
#0 tsrm_realpath (path=0x0, real_path=0xbfb0f20c "6É\025\b\001")
at /home/wwwdev/php5.2-200708201630/TSRM/tsrm_virtual_cwd.c:1266
#1 0x080a1c8c in zim_spl_SplFileInfo_getRealPath (ht=0,
return_value=0xb7d0519c,
return_value_ptr=0x0, this_ptr=0xb7d04598, return_value_used=1)
at /home/wwwdev/php5.2-200708201630/ext/spl/spl_directory.c:861
#2 0x08175cc2 in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfb103e0)
at /home/wwwdev/php5.2-200708201630/Zend/zend_vm_execute.h:202
#3 0x08174b58 in execute (op_array=0xb7d04a40)
at /home/wwwdev/php5.2-200708201630/Zend/zend_vm_execute.h:94
#4 0x081575f4 in zend_execute_scripts (type=8, retval=<value optimized
out>,
file_count=3) at /home/wwwdev/php5.2-200708201630/Zend/zend.c:1134
#5 0x08117c00 in php_execute_script (primary_file=0xbfb1279c)
at /home/wwwdev/php5.2-200708201630/main/main.c:1982
#6 0x081d1674 in main (argc=2, argv=0xbfb128a4)
at /home/wwwdev/php5.2-200708201630/sapi/cli/php_cli.c:1140
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42364&edit=1