Bug #68915 [NEW]: Failed assertion in DirectoryIterator_getExtension on '.' entry.

From: Date: Mon, 26 Jan 2015 08:26:45 +0000
Subject: Bug #68915 [NEW]: Failed assertion in DirectoryIterator_getExtension on '.' entry.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190226@lists.php.net to get a copy of this message
From: arjen at react dot com Operating system: Linux PHP version: master-Git-2015-01-26 (Git) Package: SPL related Bug Type: Bug Bug description:Failed assertion in DirectoryIterator_getExtension on '.' entry. 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 bug report at https://bugs.php.net/bug.php?id=68915&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68915&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68915&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68915&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=68915&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=68915&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=68915&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=68915&r=needscript Try newer version: https://bugs.php.net/fix.php?id=68915&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=68915&r=support Expected behavior: https://bugs.php.net/fix.php?id=68915&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=68915&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=68915&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=68915&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68915&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=68915&r=dst IIS Stability: https://bugs.php.net/fix.php?id=68915&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=68915&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=68915&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=68915&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=68915&r=mysqlcfg

« previous php.bugs (#190226) next »