From:             bfra...@php.net
Operating system: 
PHP version:      Irrelevant
Package:          Scripting Engine problem
Bug Type:         Bug
Bug description:reflection_method_invokeArgs core dump

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 bug report at https://bugs.php.net/bug.php?id=64966&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64966&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64966&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=64966&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=64966&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=64966&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=64966&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=64966&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=64966&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=64966&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=64966&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=64966&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=64966&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=64966&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64966&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=64966&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=64966&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=64966&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64966&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=64966&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64966&r=mysqlcfg

Reply via email to