Bug #68915 [Opn->Csd]: Failed assertion in DirectoryIterator_getExtension on '.' entry.

From: Date: Tue, 27 Jan 2015 07:58:51 +0000
Subject: Bug #68915 [Opn->Csd]: Failed assertion in DirectoryIterator_getExtension on '.' entry.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190242@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68915&edit=1 ID: 68915 Updated by: laruence@php.net Reported by: arjen at react dot com Summary: Failed assertion in DirectoryIterator_getExtension on '.' entry. -Status: Open +Status: Closed Type: Bug Package: SPL related Operating System: Linux PHP Version: master-Git-2015-01-26 (Git) Block user comment: N Private report: N New Comment: Automatic comment on behalf of laruence Revision: http://git.php.net/?p=php-src.git;a=commit;h=59593ba66c00220f0161a721c80550b2a0305c31 Log: Fixed #68915 (wrong assertion here) Previous Comments: ------------------------------------------------------------------------ [2015-01-26 08:26:44] arjen at react dot com Description: ------------ Running our internal testsuite in with php7 (master git up-to-date) in a normal build works fine, with --enable-debug with get the following error: php: /home/arjen/phpng/php-src/ext/spl/spl_directory.c:966: zim_spl_DirectoryIterator_getExtension: Assertion `p > fname->val' failed. (gdb) bt #0 0x00007ffff38d2a97 in raise () from /usr/lib/libc.so.6 #1 0x00007ffff38d3e6a in abort () from /usr/lib/libc.so.6 #2 0x00007ffff38cb8bd in __assert_fail_base () from /usr/lib/libc.so.6 #3 0x00007ffff38cb972 in __assert_fail () from /usr/lib/libc.so.6 #4 0x00000000007d018e in zim_spl_DirectoryIterator_getExtension (execute_data=0x7ffff0ad41f0, return_value=0x7ffff0ad4150) at /home/arjen/phpng/php-src/ext/spl/spl_directory.c:966 #5 0x000000000098f246 in ZEND_DO_FCALL_SPEC_HANDLER (execute_data=0x7ffff0ad4040) at /home/arjen/phpng/php-src/Zend/zend_vm_execute.h:596 #6 0x000000000098e7e8 in execute_ex (execute_data=0x7ffff0ad4040) at /home/arjen/phpng/php-src/Zend/zend_vm_execute.h:352 #7 0x000000000098e941 in zend_execute (op_array=0x13fcd40, return_value=0x0) at /home/arjen/phpng/php-src/Zend/zend_vm_execute.h:381 #8 0x0000000000941c99 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/arjen/phpng/php-src/Zend/zend.c:1271 #9 0x00000000008b923a in php_execute_script (primary_file=0x7fffffffdff0) at /home/arjen/phpng/php-src/main/main.c:2554 #10 0x00000000009e4acd in do_cli (argc=2, argv=0x1267520) at /home/arjen/phpng/php-src/sapi/cli/php_cli.c:982 #11 0x00000000009e5a76 in main (argc=2, argv=0x1267520) at /home/arjen/phpng/php-src/sapi/cli/php_cli.c:1361 If it fails, the currenct DirectoryIterator entry is a '.' entry. Test script: --------------- <?php $it = new DirectoryIterator(__DIR__); foreach ($it as $entry) { var_dump($entry->getPathname(), $entry->getExtension()); } Expected result: ---------------- No assertion. Empty string for directory entries without extension: "Returns a string containing the file extension, or an empty string if the file has no extension." Actual result: -------------- php: /home/arjen/phpng/php-src/ext/spl/spl_directory.c:966: zim_spl_DirectoryIterator_getExtension: Assertion `p > fname->val' failed. (gdb) bt #0 0x00007ffff38d2a97 in raise () from /usr/lib/libc.so.6 #1 0x00007ffff38d3e6a in abort () from /usr/lib/libc.so.6 #2 0x00007ffff38cb8bd in __assert_fail_base () from /usr/lib/libc.so.6 #3 0x00007ffff38cb972 in __assert_fail () from /usr/lib/libc.so.6 #4 0x00000000007d018e in zim_spl_DirectoryIterator_getExtension (execute_data=0x7ffff0ad41f0, return_value=0x7ffff0ad4150) at /home/arjen/phpng/php-src/ext/spl/spl_directory.c:966 #5 0x000000000098f246 in ZEND_DO_FCALL_SPEC_HANDLER (execute_data=0x7ffff0ad4040) at /home/arjen/phpng/php-src/Zend/zend_vm_execute.h:596 #6 0x000000000098e7e8 in execute_ex (execute_data=0x7ffff0ad4040) at /home/arjen/phpng/php-src/Zend/zend_vm_execute.h:352 #7 0x000000000098e941 in zend_execute (op_array=0x13fcd40, return_value=0x0) at /home/arjen/phpng/php-src/Zend/zend_vm_execute.h:381 #8 0x0000000000941c99 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/arjen/phpng/php-src/Zend/zend.c:1271 #9 0x00000000008b923a in php_execute_script (primary_file=0x7fffffffdff0) at /home/arjen/phpng/php-src/main/main.c:2554 #10 0x00000000009e4acd in do_cli (argc=2, argv=0x1267520) at /home/arjen/phpng/php-src/sapi/cli/php_cli.c:982 #11 0x00000000009e5a76 in main (argc=2, argv=0x1267520) at /home/arjen/phpng/php-src/sapi/cli/php_cli.c:1361 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68915&edit=1

« previous php.bugs (#190242) next »