Edit report at https://bugs.php.net/bug.php?id=64966&edit=1
ID: 64966 Updated by: bfra...@php.net Reported by: bfra...@php.net Summary: reflection_method_invokeArgs core dump Status: Feedback Type: Bug Package: Scripting Engine problem PHP Version: Irrelevant Block user comment: N Private report: N New Comment: I wish I could and I have been trying. If you move line: 35 $GLOBALS['oo-mode']=false; in the test case to line 9, then the core dumps goes away with 5.3.x. When I start trimming down the test case, the core dump goes away. That is the smallest test case I have been able to come up with that core dumps 5.3.x. For 5.4.x you can trim the test case down to just the first test (line 33) and it still has issues. Just add two close braces and a closing php tag on line 34 and nuke the rest of the file. The problem is collator_sort is never called, so the global intl_get_error_message() stuff is never setup. http://git.php.net/?p=php-src.git;a=blob;f=ext/intl/collator/collator_sort.c;h=0785111c964b476da2c1d169bad65f0ab1048fa9;hb=refs/heads/PHP-5.4#l289 Line 343 PHP_FUNCTION( collator_sort ) calls collator_sort_internal from line 289. Line 299 should fail and line 302 should setup the intl_get_error_message() stuff with U_ILLEGAL_ARGUMENT_ERROR. But collator_sort (zif_collator_sort) is never called. Previous Comments: ------------------------------------------------------------------------ [2013-06-04 03:52:01] larue...@php.net could you refine this into one simple test script? ------------------------------------------------------------------------ [2013-06-03 19:41:48] bfra...@php.net Description: ------------ I don't think this is reflection related, as the issue started with this Exception patch: zend_do_fcall_common_helper_SPEC does not handle exceptions properly https://bugs.php.net/bug.php?id=63914 but have do not have a good way to describe this bug, so I used the backtrace info. 5.3.24+ : core dumps 5.4.15+ : doesn't execute the code right (same with 5.5.0RC2) Build and install either version of php with pear and intl support. You will need icu installed (pkg: icu, libicu, libicu-devel) for intl support. Install phpunit: pear config-set auto_discover 1 pear install pear.phpunit.de/PHPUnit cd php-5.x.x/ext/intl/tests setup env: % export TZ=US/Pacific % export LANG=en_US.UTF-8 % export LC_ALL= Copy test case: curl -O http://www.brianfrance.com/php/phpIntlTest02.txt mv phpIntlTest02.txt phpIntlTest02.php php -dopen_basedir= /usr/local/bin/phpunit --log-junit results.xml phoIntlTest02.php For 5.3.24+ you will get a core dump with the following backtrace: #0 _zval_ptr_dtor (zval_ptr=0x7ffff7ebfe70) at php-5.3.24/Zend/zend_execute_API.c:441 #1 0x00000000007038a6 in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7ebfa98) at php-5.3.24/Zend/zend_vm_execute.h:418 #2 0x00000000006dc948 in execute (op_array=0xfb6508) at php-5.3.24/Zend/zend_vm_execute.h:107 #3 0x00000000006ae1b0 in zend_call_function (fci=0x7fffffffaab0, fci_cache=<value optimized out>) at php-5.3.24/Zend/zend_execute_API.c:969 #4 0x0000000000583a8a in zim_reflection_method_invokeArgs (ht=<value optimized out>, return_value=0x115dab0, return_value_ptr=<value optimized out>, this_ptr=<value optimized out>, return_value_used=<value optimized out>) at php-5.3.24/ext/reflection/php_reflection.c:2753 #5 0x0000000000703d37 in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7ebed68) at php-5.3.24/Zend/zend_vm_execute.h:322 #6 0x00000000006dc948 in execute (op_array=0x10f0d48) at php-5.3.24/Zend/zend_vm_execute.h:107 #7 0x00000000006b758a in zend_execute_scripts (type=8, retval=0x0, file_count=3) at php-5.3.24/Zend/zend.c:1259 #8 0x0000000000666ace in php_execute_script (primary_file=0x7fffffffe170) at php-5.3.24/main/main.c:2316 #9 0x000000000073de34 in main (argc=6, argv=0x7fffffffe3e8) at php-5.3.24/sapi/cli/php_cli.c:1189 For 5.4.15+ you get a weird code execution happening. collator_sort is never called on line 17. You can test this by gdb'ing and setting a break point on zif_collator_sort, it will never hit. It is like something triggered the exception before collator_sort is called. This means that callator_sort didn't setup intl_get_error_message() error message about the bad param, so then the test fails on line 33. This test works with 5.3.23 with no core dump and works with 5.3.24 if you revert the bug #63914 patch. Test script: --------------- http://www.brianfrance.com/php/phpIntlTest02.txt ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=64966&edit=1