ID: 32327 Updated by: [EMAIL PROTECTED] Reported By: tm at iprog dot com -Status: Open +Status: Feedback Bug Type: Reproducible crash Operating System: os x 10.3 / linux 2.4 PHP Version: 5.0.3 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-03-15 22:38:07] tm at iprog dot com Description: ------------ Tested on PHP 5.0.3 on Mac OS X 10.3.8 and also PHP 5.0.2 on Linux 2.4.22. Reproducible from inside Apache and also on command line via PHP-CLI. To reproduce, do the following: % mkdir breakme % chmod -r breakme % php crash1.php Because of the lack of permissions on directory 'breakme', the script will segfault. If breakme has read perms, the script executes fine. Additionally, if line 14 of the script is changed to: $rdir = new resourcedir('./breakme'); then an exception is generated. However, for some reason it is not being generated with the example as provided. Reproduce code: --------------- <?php class resourcedir extends DirectoryIterator { public function __construct($newdir) { print "__c:$newdir\n"; parent::__construct($newdir); } public function current() { parent::current(); if ($this->isDir()) return new resourcedir($this->getpathname()); return null; } } $rdir = new resourcedir('.'); foreach ($rdir as $res) if (is_object($res)) print 'dir:'.$res->getPathname()."\n"; ?> Expected result: ---------------- A basic directory listing w/o a seg fault. Actual result: -------------- The directory listing up until it hits the restricted directory and then a seg fault. >From OS X's crash log (when running via apache): Date/Time: 2005-03-15 14:21:52 -0700 OS Version: 10.3.8 (Build 7U16) Report Version: 2 Command: httpd Path: /usr/sbin/httpd Version: ??? (???) PID: 29678 Thread: 0 Exception: EXC_BAD_ACCESS (0x0001) Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000008 Thread 0 Crashed: 0 libphp5.so 0x02e0c664 zend_fe_fetch_handler + 0x5c8 1 libphp5.so 0x02e03178 execute + 0x1f0 2 libphp5.so 0x02dd0d58 zend_execute_scripts + 0x140 3 libphp5.so 0x02d73d68 php_execute_script + 0x380 4 libphp5.so 0x02e134d8 apache_php_module_main + 0xd4 5 libphp5.so 0x02e14818 send_php + 0x380 6 libphp5.so 0x02e14898 send_parsed_php + 0x28 7 httpd 0x0000dbbc ap_invoke_handler + 0xe8 8 httpd 0x00017c6c process_request_internal + 0x280 9 httpd 0x00017cec ap_process_request + 0x48 10 httpd 0x00006a10 child_main + 0x69c 11 httpd 0x00006c74 make_child + 0x138 12 httpd 0x00006fa4 perform_idle_server_maintenance + 0x23c 13 httpd 0x00007580 standalone_main + 0x3c4 14 httpd 0x00007c24 main + 0x41c 15 httpd 0x000027a8 _start + 0x188 16 httpd 0x0000261c start + 0x30 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32327&edit=1